Home > Software engineering >  VS2010 VB how to write in the pop-up dialog box automatically determined?
VS2010 VB how to write in the pop-up dialog box automatically determined?

Time:09-19

Haven't touch VB (like before), now suddenly you need a small program, and it is real-time monitoring, let it help me to complete a small function:

How to help me to click on the pop-up dialog box automatically determine button? These requirements are the background completely, does not affect the normal mouse, keyboard operation (such as the Internet, entertainment, etc.)

CodePudding user response:

This has nothing to do with "platform"!
A variety of programming environments, thinking about the same,

If it is in the "user action" pop-up message box, this news should be in the "front desk" active window,
Can use GetForegroundWindow () to get the message box handle,
And then to handle value "ok" button to find the handle, it is ok to send it WM_LBUTTONDBLCLK,

If it is a "daemon" operation, in some cases a message prompt, it shall pay the window class name, the window title for the window,

To achieve the so-called "real-time", one is to HOOK the window to create several related API (difficult),
It can intercept window is created by "monitored" message box, how much is the handle value,
Method 2, easy to implement, is to use "timer events," have you ever been monitoring window kept "find" (message box),
If found (a), and then find it "ok" button on the handle, send the WM_LBUTTONDBLCLK message,
, after all, in most cases, close the message box "" real-time demand is not high, as long as the timer clock cycle short point,

CodePudding user response:

In addition, if the message box is only "certain" that don't have to look "ok" button on the handle, directly to the WM_CLOSE message box sent to go,

CodePudding user response:

reference 1st floor Chen8013 response:
this has nothing to do with "platform"!
A variety of programming environments, thinking about the same,

If it is in the "user action" pop-up message box, this news should be in the "front desk" active window,
Can use GetForegroundWindow () to get the message box handle,
And then to handle value "ok" button to find the handle, it is ok to send it WM_LBUTTONDBLCLK,

if it is a "daemon" operation, in some cases a message prompt, it shall pay the window class name, the window title for the window,

To achieve the so-called "real-time", one is to HOOK the window to create several related API (difficult),
It can intercept window is created by "monitored" message box, how much is the handle value,
Method 2, easy to implement, is to use "timer events," have you ever been monitoring window kept "find" (message box),
If found (a), and then find it "ok" button on the handle, send the WM_LBUTTONDBLCLK message,
, after all, in most cases, close the message box "" real-time demand is not high, as long as the timer clock cycle short point,


How to "in accordance with the window class, window title to find window"? Can go into more detail about, because do not understand, and now only need such a small program, so it is difficult to do it again system learning VB.net... A great god, please give directions,

CodePudding user response:

reference 1st floor Chen8013 response:
...
If it is a "daemon" operation, in some cases a message prompt, it shall pay the window class name, the window title for the window,
.


Is to use own SPY++ VS2010?

CodePudding user response:

Will use Spy++? (or a similar function of other tools)
In the message box do you want to "monitor", see the class name, title words!
If it is the kind of message box "looks very ordinary, were mostly call User32. DLL in MessageBox,
It "is the name of the class" is # 32770, title text is shown on the title bar of the text,
If they are "custom painting message box", to use tools to see the class name and title text,
Rogue messages such as figures, it is the name of the class of Q360HIPSClass, it seems to be heading to "see" the title of the (remember, I didn't install digital rogue),
Such as QQ, it again "at the bottom right popup window", the message box class name is TXGuiFoundation, you may be a variety of "see the title of" there are many different;
But, in fact, it's that "real title text" only two: tencent video and dacheng news


VB6, or VB.NET, use the API "principles are the same,"
It's just there are a few differences in the "details" : for example, how to declare or referenced DLL export functions differ "writing",

Your search FindWindow and FindWindowEx both API introduced, online are everywhere...
I'll repeat here also does not make sense,

CodePudding user response:

Xiao8xiao
reference 4 floor response:
Quote: refer to 1st floor Chen8013 response:

.
If it is a "daemon" operation, in some cases a message prompt, it shall pay the window class name, the window title for the window,
.


Is to use own SPY++ VS2010?

Spy++ I said is that, VC, VS with, as long as the installation time chose the "tools" this component, it certainly will be installed,
After all for "programming", as long as involving "to deal with other program window", basic on it (or a similar replacement tools),

CodePudding user response:

http://www.autohotkey.com
  •  Tags:  
  • API
  • Related