Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

An Advanced Technique.


  • Please log in to reply
62 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Tutorial on posting messages to Windows

This post will answer some questions like :

"how do i press a button on a minimized window?"
"how do i select this f****** menu item, WinMenuSelectItem doesn't work with it?!"
"this is a skinnable window.... how do i send a cmd that works everytime?"
"and what about *hidden* windows?!"


requirements:
Winspector Spy (http://www.windows-spy.com)
AHK's latest version


Note: I'm using WinXP Pro (SP1) ... if you use a different OS then your params may change (only applicable to apps like wordpad and notepad etc that come with windows, for others params won't change).


first try selecting the Insert > Picture in outlook express's new message window by WinMenuSelectItem...
WinMenuSelectItem, New Message,, &Insert, &Picture...

even try AU3's command:
WinMenuSelectItem ( "New Message", "", "&Insert" , "&Picture...")

i had no luck!


now try this:
PostMessage, 0x111, 40239, 0, , New Message
works like a charm!!

but what the hell is that?... 0x111 is that hex code of wm_command message. and 40239 is the code that this particular window understands as menu-item 'Insert Picture' selection.

now let me tell u how to find this value:
open Winspector Spy and new message window. drag the crosshair from Winspector Spy's window to new message window's titlebar. now right click the selected window in the list on left and select 'messages'. right click the blank window and select 'edit msg filter' . press the 'filter all' button and then dbl click 'wm_command' on the list on left. this way you will only monitor this message.

now go to New Message window and select Insert> Picture.

come back to Winspector Spy and pres the traffic light button to pause monitoring... now expand the wm_command messages that've accumulated (forget others if any). now what you want to look for is a code 0 message. sometimes there're wm_command messages saying 'win activated' or 'win distroyed' and other crap... not needed. u'll find that there's be a message saying 'Control ID: 40239' ...that's it!

now put that in the above command and u've got it!! ..its the wparam value.


for next example i'm taking paint bcoz possibly everyone will have that. now let's say its an app where u've to select a tool from a toolbar using AHK. say dropper tool is to be selected.

what'd u do? ... most probably a mouse click at the toolbar button. right?... but toolbars can be moved and hidden! ...this one can be moved/hidden too... so if the target user has done any of this then ur script will fail at that point. but the following command will still work:

PostMessage, 0x111, 639,,,untitled - Paint

also mouse clicks requires window activation.... while this doesn't!!!


here are some more examples:

;makes writing color teal in wordpad
;PostMessage, 0x111, 32788, 0, , Document - WordPad

;opens about box in notepad
;PostMessage, 0x111, 65, 0, , Untitled - Notepad

;toggles word-wrap in notepad
;PostMessage, 0x111, 32, 0, , Untitled - Notepad

;play/pause in Windows Media Player
;PostMessage, 0x111, 32808, 0, , Windows Media Player

Note: There are apps with which this technique doesn't work. I've had mixed luck with VB and Delphi apps. This technique is best used with C, C++ apps. With VB apps the 'LParam' of the same command keeps changing from one run to another. With Delphi apps... the GUI of some apps doesn't even use wm_command. It probably uses mouse pos & clicks.

You can find the offline version of this tutorial in the AutoHotkey help file (link in PostMessage/SendMessage command help)

This was Postmessage, sendmessage works the same way but additionally waits for a return value... this has uses too, like it can get you the currently playing track in winamp (see AHK help for example script)


Here are a couple of notes :

1. The note above regarding OS being XP and msg values changing with different OSes is purely cautionary. if you've found a msg that works on your system (with a certain version of a software) then you can be sure it'll work on another system too with the same version of the software. most softwares keep these msg values same even on different versions (eg. windows media player and winamp).

2. If you've set the filter to show only wm_command in Winspector Spy and still you're getting a flood of messages then right click that message and select hide (msg name)... you don't want to have a look at a msg that appears without you interacting with the target software.

3. The right pointing arrow in Winspector Spy shows the msg values and the blurred left pointing arrows show the returned value. A 0 (zero) value can by default safely be taken as 'no error' (use it with sendmessage, the retrun value is in %errorlevel%).

4. for posting to part - title match add this to script:
SetTitleMatchMode, 2

for posting to hidden windows add this to script:
DetectHiddenWindows, On

a cool example:
;this will suspend the hotkeys of a running AHK script!
;PostMessage, 0x111, 32800,,,AutoHotkey v1.0.

this was to get you acquainted with the advanced commands that Chris has put in AHK... well it took some coaxing to get him to do it ;) but it was well worth it!!

I've uploaded a long list of messages that can be sent from ahk here

You can use this script to find the hex code of a particular message very fast. The code also gets copied to the clipboard.

MainWnd = MsgSeeker by Rajat
SetKeyDelay, 0


Loop, Read, %A_ScriptDir%\messages.txt
{
	IfEqual, A_LoopReadLine,, Continue
	ItemList = %ItemList%|%A_LoopReadLine%
}

StringTrimLeft, ItemList, ItemList, 1

Gui, +Border -Caption
Gui, Font,, Courier
Gui, Add, Edit, x6 y5 w650 h20, 
Gui, Add, ListBox, x6 y35 w770 h220 vSelItem, 
Gui, Add, Button, x666 y5 w50 h20 Default, &Open
Gui, Add, Button, x726 y5 w50 h20, &Add
Gui, Show, h252 w781, %MainWnd%

SetTimer, GetText, 100
Return


Up::
	IfWinNotActive, %MainWnd%,
	{
		Send, {Up}
		Return
	}
	ControlGetFocus, CurrCtrl, %MainWnd%
	IfEqual, CurrCtrl, Edit1
		ControlSend, ListBox1, {Up}, %MainWnd%
Return
	

Down::
	IfWinNotActive, %MainWnd%,
	{
		Send, {Down}
		Return
	}
	ControlGetFocus, CurrCtrl, %MainWnd%
	IfEqual, CurrCtrl, Edit1
		ControlSend, ListBox1, {Down}, %MainWnd%
Return




GetText:
	ControlGetText, CurrText, Edit1, %MainWnd%

	IfNotEqual, CurrText, %LastText%
	{
		LastText = %CurrText%
		MatchList =
		Loop, Parse, ItemList, |
		{
			CurrItem = %A_LoopField%
			
			MatchFound = Y
			
			Loop, Parse, CurrText, %A_Space%
				IfNotInString, CurrItem, %A_LoopField%
					MatchFound = N
			
			IfEqual, MatchFound, Y
				MatchList = %MatchList%|%CurrItem%
		}
		StringTrimLeft, MatchList, MatchList, 1
		GuiControl,, ListBox1, |%MatchList%
	}
Return


ButtonOpen:
	GetKeyState, ShKey, Shift
	ControlFocus, ListBox1, %MainWnd%
	ControlSend, ListBox1, {Space}, %MainWnd%
	
	Gui, Submit
	Sleep, 50
	IfEqual, ShKey, D, StringUpper, SelItem, SelItem
	
	StringGetPos, tPos, SelItem, %A_Tab%
	StringLeft, SelItem, SelItem, %tPos%
	ClipBoard = %SelItem%

	ExitApp
Return


ButtonAdd:
	ControlGetText, CurrText, Edit1, %MainWnd%
	IfEqual, CurrText,, Return
	FileAppend, `n%CurrText%, %A_ScriptDir%\Files\ItemList.txt
	ItemList = %ItemList%|%CurrText%
	LastText =
Return


ButtonExit:
GuiEscape:
GuiClose:
	ExitApp

go and explore.... and share your experiences.

feedback is welcome!

This tutorial is not meant for total newbies... no offence meant, but as AHK help already considers these as advanced functions so if after reading the tutorial u've not made head or tail of it, then plz forget it.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004
Rajat,

Thanks for the tutorial. I hadn't looked into the PostMessage and SendMessage features. Now I have some ideas to use on a couple of scripts I have.

thanks,
beardboy

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I'd like ppl who've found out some nice commands to share them here... it'd help ppl not have to rediscover the wheel.

the following are for Winamp:


WM_COMMAND Messages (hex code 0x111)

(the values are for wparam)


Previous track button 40044
Next track button 40048
Play button 40045
Pause/Unpause button 40046
Stop button 40047
Fadeout and stop 40147
Stop after current track 40157
Fast-forward 5 seconds 40148
Fast-rewind 5 seconds 40144
Start of playlist 40154
Go to end of playlist 40158
Open file dialog 40029
Open URL dialog 40155
Open file info box 40188
Set time display mode to elapsed 40037
Set time display mode to remaining 40038
Toggle preferences screen 40012
Open visualization options 40190
Open visualization plug-in options 40191
Execute current visualization plug-in 40192
Toggle about box 40041
Toggle title Autoscrolling 40189
Toggle always on top 40019
Toggle Windowshade 40064
Toggle Playlist Windowshade 40266
Toggle doublesize mode 40165
Toggle EQ 40036
Toggle playlist editor 40040
Toggle main window visible 40258
Toggle minibrowser 40298
Toggle easymove 40186
Raise volume by 1% 40058
Lower volume by 1% 40059
Toggle repeat 40022
Toggle shuffle 40023
Open jump to time dialog 40193
Open jump to file dialog 40194
Open skin selector 40219
Configure current visualization plug-in 40221
Reload the current skin 40291
Close Winamp 40001
Moves back 10 tracks in playlist 40197
Show the edit bookmarks 40320
Adds current track as a bookmark 40321
Play audio CD 40323
Load a preset from EQ 40253
Save a preset to EQF 40254
Opens load presets dialog 40172
Opens auto-load presets dialog 40173
Load default preset 40174
Opens save preset dialog 40175
Opens auto-load save preset 40176
Opens delete preset dialog 40178
Opens delete an auto load preset dialog 40180





WM_USER Messages (hex code 0x400)

(the values are for lparam)


0 Retrieves the version of Winamp running. Version will be 0x20yx for 2.yx. This is a good way to determine if you did in fact find the right window, etc.
100 Starts playback. A lot like hitting 'play' in Winamp, but not exactly the same
101 Clears Winamp's internal playlist.
102 Begins play of selected track.
103 Makes Winamp change to the directory C:\\download
104 Returns the status of playback. If 'ret' is 1, Winamp is playing. If 'ret' is 3, Winamp is paused. Otherwise, playback is stopped.
105 If data is 0, returns the position in milliseconds of playback. If data is 1, returns current track length in seconds. Returns -1 if not playing or if an error occurs.
106 Seeks within the current track. The offset is specified in 'data', in milliseconds.
120 Writes out the current playlist to Winampdir\winamp.m3u, and returns the current position in the playlist.
121 Sets the playlist position to the position specified in tracks in 'data'.
122 Sets the volume to 'data', which can be between 0 (silent) and 255 (maximum).
123 Sets the panning to 'data', which can be between 0 (all left) and 255 (all right).
124 Returns length of the current playlist, in tracks.
125 Returns the position in the current playlist, in tracks (requires Winamp 2.05+).
126 Retrieves info about the current playing track. Returns samplerate (i.e. 44100) if 'data' is set to 0, bitrate if 'data' is set to 1, and number of channels if 'data' is set to 2. (requires Winamp 2.05+)
127 Retrieves one element of equalizer data, based on what 'data' is set to.
0-9 The 10 bands of EQ data. Will return 0-63 (+20db - -20db)
10 The preamp value. Will return 0-63 (+20db - -20db)
11 Enabled. Will return zero if disabled, nonzero if enabled.

128 Autoload. Will return zero if disabled, nonzero if enabled. To set an element of equalizer data, simply query which item you wish to set using the message above (127), then call this message with data
129 Adds the specified file to the Winamp bookmark list
135 Restarts Winamp

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
thanx for the feedback beardboy.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
and here's a list of some message codes that might come handy...

WM_NULL             = 0x0000;
  WM_CREATE           = 0x0001;
  WM_DESTROY          = 0x0002;
  WM_MOVE             = 0x0003;
  WM_SIZE             = 0x0005;
  WM_ACTIVATE         = 0x0006;
  WM_SETFOCUS         = 0x0007;
  WM_KILLFOCUS        = 0x0008;
  WM_ENABLE           = 0x000A;
  WM_SETREDRAW        = 0x000B;
  WM_SETTEXT          = 0x000C;
  WM_GETTEXT          = 0x000D;
  WM_GETTEXTLENGTH    = 0x000E;
  WM_PAINT            = 0x000F;
  WM_CLOSE            = 0x0010;
  WM_QUERYENDSESSION  = 0x0011;
  WM_QUIT             = 0x0012;
  WM_QUERYOPEN        = 0x0013;
  WM_ERASEBKGND       = 0x0014;
  WM_SYSCOLORCHANGE   = 0x0015;
  WM_ENDSESSION       = 0x0016;
  WM_SYSTEMERROR      = 0x0017;
  WM_SHOWWINDOW       = 0x0018;
  WM_CTLCOLOR         = 0x0019;
  WM_WININICHANGE     = 0x001A;
  WM_SETTINGCHANGE    = 0x001A;
  WM_DEVMODECHANGE    = 0x001B;
  WM_ACTIVATEAPP      = 0x001C;
  WM_FONTCHANGE       = 0x001D;
  WM_TIMECHANGE       = 0x001E;
  WM_CANCELMODE       = 0x001F;
  WM_SETCURSOR        = 0x0020;
  WM_MOUSEACTIVATE    = 0x0021;
  WM_CHILDACTIVATE    = 0x0022;
  WM_QUEUESYNC        = 0x0023;
  WM_GETMINMAXINFO    = 0x0024;
  WM_PAINTICON        = 0x0026;
  WM_ICONERASEBKGND   = 0x0027;
  WM_NEXTDLGCTL       = 0x0028;
  WM_SPOOLERSTATUS    = 0x002A;
  WM_DRAWITEM         = 0x002B;
  WM_MEASUREITEM      = 0x002C;
  WM_DELETEITEM       = 0x002D;
  WM_VKEYTOITEM       = 0x002E;
  WM_CHARTOITEM       = 0x002F;
  WM_SETFONT          = 0x0030;
  WM_GETFONT          = 0x0031;
  WM_SETHOTKEY        = 0x0032;
  WM_GETHOTKEY        = 0x0033;
  WM_QUERYDRAGICON    = 0x0037;
  WM_COMPAREITEM      = 0x0039;
  WM_COMPACTING       = 0x0041;

  WM_COMMNOTIFY       = 0x0044;    { obsolete in Win32}

  WM_WINDOWPOSCHANGING = 0x0046;
  WM_WINDOWPOSCHANGED = 0x0047;
  WM_POWER            = 0x0048;

  WM_COPYDATA         = 0x004A;
  WM_CANCELJOURNAL    = 0x004B;
  WM_NOTIFY           = 0x004E;
  WM_INPUTLANGCHANGEREQUEST = 0x0050;
  WM_INPUTLANGCHANGE  = 0x0051;
  WM_TCARD            = 0x0052;
  WM_HELP             = 0x0053;
  WM_USERCHANGED      = 0x0054;
  WM_NOTIFYFORMAT     = 0x0055;

  WM_CONTEXTMENU      = 0x007B;
  WM_STYLECHANGING    = 0x007C;
  WM_STYLECHANGED     = 0x007D;
  WM_DISPLAYCHANGE    = 0x007E;
  WM_GETICON          = 0x007F;
  WM_SETICON          = 0x0080;

  WM_NCCREATE         = 0x0081;
  WM_NCDESTROY        = 0x0082;
  WM_NCCALCSIZE       = 0x0083;
  WM_NCHITTEST        = 0x0084;
  WM_NCPAINT          = 0x0085;
  WM_NCACTIVATE       = 0x0086;
  WM_GETDLGCODE       = 0x0087;
  WM_NCMOUSEMOVE      = 0x00A0;
  WM_NCLBUTTONDOWN    = 0x00A1;
  WM_NCLBUTTONUP      = 0x00A2;
  WM_NCLBUTTONDBLCLK  = 0x00A3;
  WM_NCRBUTTONDOWN    = 0x00A4;
  WM_NCRBUTTONUP      = 0x00A5;
  WM_NCRBUTTONDBLCLK  = 0x00A6;
  WM_NCMBUTTONDOWN    = 0x00A7;
  WM_NCMBUTTONUP      = 0x00A8;
  WM_NCMBUTTONDBLCLK  = 0x00A9;

  WM_KEYFIRST         = 0x0100;
  WM_KEYDOWN          = 0x0100;
  WM_KEYUP            = 0x0101;
  WM_CHAR             = 0x0102;
  WM_DEADCHAR         = 0x0103;
  WM_SYSKEYDOWN       = 0x0104;
  WM_SYSKEYUP         = 0x0105;
  WM_SYSCHAR          = 0x0106;
  WM_SYSDEADCHAR      = 0x0107;
  WM_KEYLAST          = 0x0108;

  WM_INITDIALOG       = 0x0110;
  WM_COMMAND          = 0x0111;
  WM_SYSCOMMAND       = 0x0112;
  WM_TIMER            = 0x0113;
  WM_HSCROLL          = 0x0114;
  WM_VSCROLL          = 0x0115;
  WM_INITMENU         = 0x0116;
  WM_INITMENUPOPUP    = 0x0117;
  WM_MENUSELECT       = 0x011F;
  WM_MENUCHAR         = 0x0120;
  WM_ENTERIDLE        = 0x0121;

  WM_CTLCOLORMSGBOX   = 0x0132;
  WM_CTLCOLOREDIT     = 0x0133;
  WM_CTLCOLORLISTBOX  = 0x0134;
  WM_CTLCOLORBTN      = 0x0135;
  WM_CTLCOLORDLG      = 0x0136;
  WM_CTLCOLORSCROLLBAR= 0x0137;
  WM_CTLCOLORSTATIC   = 0x0138;

  WM_MOUSEFIRST       = 0x0200;
  WM_MOUSEMOVE        = 0x0200;
  WM_LBUTTONDOWN      = 0x0201;
  WM_LBUTTONUP        = 0x0202;
  WM_LBUTTONDBLCLK    = 0x0203;
  WM_RBUTTONDOWN      = 0x0204;
  WM_RBUTTONUP        = 0x0205;
  WM_RBUTTONDBLCLK    = 0x0206;
  WM_MBUTTONDOWN      = 0x0207;
  WM_MBUTTONUP        = 0x0208;
  WM_MBUTTONDBLCLK    = 0x0209;
  WM_MOUSEWHEEL       = 0x020A; 
  WM_MOUSELAST        = 0x020A;

  WM_PARENTNOTIFY     = 0x0210;
  WM_ENTERMENULOOP    = 0x0211;
  WM_EXITMENULOOP     = 0x0212;
  WM_NEXTMENU         = 0x0213;

  WM_SIZING           = 532;
  WM_CAPTURECHANGED   = 533;
  WM_MOVING           = 534;
  WM_POWERBROADCAST   = 536;
  WM_DEVICECHANGE     = 537;

  WM_IME_STARTCOMPOSITION        = 0x010D;
  WM_IME_ENDCOMPOSITION          = 0x010E;
  WM_IME_COMPOSITION             = 0x010F;
  WM_IME_KEYLAST                 = 0x010F;

  WM_IME_SETCONTEXT              = 0x0281;
  WM_IME_NOTIFY                  = 0x0282;
  WM_IME_CONTROL                 = 0x0283;
  WM_IME_COMPOSITIONFULL         = 0x0284;
  WM_IME_SELECT                  = 0x0285;
  WM_IME_CHAR                    = 0x0286;

  WM_IME_KEYDOWN                 = 0x0290;
  WM_IME_KEYUP                   = 0x0291;

  WM_MDICREATE        = 0x0220;
  WM_MDIDESTROY       = 0x0221;
  WM_MDIACTIVATE      = 0x0222;
  WM_MDIRESTORE       = 0x0223;
  WM_MDINEXT          = 0x0224;
  WM_MDIMAXIMIZE      = 0x0225;
  WM_MDITILE          = 0x0226;
  WM_MDICASCADE       = 0x0227;
  WM_MDIICONARRANGE   = 0x0228;
  WM_MDIGETACTIVE     = 0x0229;
  WM_MDISETMENU       = 0x0230;

  WM_ENTERSIZEMOVE    = 0x0231;
  WM_EXITSIZEMOVE     = 0x0232;
  WM_DROPFILES        = 0x0233;
  WM_MDIREFRESHMENU   = 0x0234;

  WM_MOUSEHOVER       = 0x02A1; 
  WM_MOUSELEAVE       = 0x02A3;

  WM_CUT              = 0x0300;
  WM_COPY             = 0x0301;
  WM_PASTE            = 0x0302;
  WM_CLEAR            = 0x0303;
  WM_UNDO             = 0x0304;
  WM_RENDERFORMAT     = 0x0305;
  WM_RENDERALLFORMATS = 0x0306;
  WM_DESTROYCLIPBOARD = 0x0307;
  WM_DRAWCLIPBOARD    = 0x0308;
  WM_PAINTCLIPBOARD   = 0x0309;
  WM_VSCROLLCLIPBOARD = 0x030A;
  WM_SIZECLIPBOARD    = 0x030B;
  WM_ASKCBFORMATNAME  = 0x030C;
  WM_CHANGECBCHAIN    = 0x030D;
  WM_HSCROLLCLIPBOARD = 0x030E;
  WM_QUERYNEWPALETTE  = 0x030F;
  WM_PALETTEISCHANGING= 0x0310;
  WM_PALETTECHANGED   = 0x0311;
  WM_HOTKEY           = 0x0312;

  WM_PRINT            = 791;
  WM_PRINTCLIENT      = 792;

  WM_HANDHELDFIRST    = 856;
  WM_HANDHELDLAST     = 863;

  WM_PENWINFIRST      = 0x0380;
  WM_PENWINLAST       = 0x038F;

  WM_COALESCE_FIRST   = 0x0390;
  WM_COALESCE_LAST    = 0x039F;

  WM_DDE_FIRST        = 0x03E0;
  WM_DDE_INITIATE     = 0x03E0;
  WM_DDE_TERMINATE    = 0x03E1;
  WM_DDE_ADVISE       = 0x03E2;
  WM_DDE_UNADVISE     = 0x03E3;
  WM_DDE_ACK          = 0x03E4;
  WM_DDE_DATA         = 0x03E5;
  WM_DDE_REQUEST      = 0x03E6;
  WM_DDE_POKE         = 0x03E7;
  WM_DDE_EXECUTE      = 0x03E8;
  WM_DDE_LAST         = 0x03E8;

  WM_APP              = 0x8000;

  WM_USER             = 0x0400;

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
some helpful notes have been added to the original post.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
You've done things with PostMessage I hadn't dreamed possible. That makes these commands have much greater potential than I had expected (very open ended in their capabilities for automating even non-standard controls and windows).

Thanks for your research and the tutorial.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Thanx Chris!

btw main post is updated again.... forgot mentioning that messages can be posted to hidden windows too!! ... and even to hidden controls!!

Isn't message posting total automation nirvana? 8)

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Beastmaster
  • Members
  • 191 posts
  • Last active: Apr 23 2007 02:58 PM
  • Joined: 15 Apr 2004
That could have saved my life :D Thx. Rajat

You seems to know what I've tried to accomplish during the last few days

f*%*&* menu item, why this f*%*&* billing app doesn't work with it?!"


:idea: have a few drinks on my ticket :lol: Cheers, Beastmaster

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
glad to be of help Beastmaster :)

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Beastmaster
  • Members
  • 191 posts
  • Last active: Apr 23 2007 02:58 PM
  • Joined: 15 Apr 2004
Hey,
currently I try to get an idea what can be done to trick an annoying VBApp following the above advise. Therefore I would be very happy if some of you guys (and girls 8) ) could provide some more tiny single line code snippets.

Of course I tried to get what it needs using the WinSpy tool. Nevertheless it seems that I'm to stupid to set the focus after a search to a manadatory listbox to select the topmost result/line which has been found.

I try to prevent mouse moves to be on the save side if a form's scale or screen coordinates will change after an update/upgrade. And there are no keyboard shortcuts set to trigger a function on that form.

Thx.
Beastmaster

All info I've found with Google about WM_xxxxxxxx is embedded in some VB code and is more confusing me then it helps ...

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
This technique is successful mostly with apps written in C only (C++ included).

With VB apps the 'LParam' of the same command keeps changing from one run to another.

With Delphi apps... I don't think the GUI even talks using wm_command... seems like it uses mouse pos & clicks !

... though u can simulate mouseclicks too using postmessage, but probably that'd not apply to hidden/moved buttons. that's what i think, i've not used mouseclicks using postmessage. though there's still the benefit that this way mouseclicks won't require window to be activated.

i will update the main post with this info.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


mAdDoG
  • Members
  • 75 posts
  • Last active: Jan 11 2010 11:05 PM
  • Joined: 29 Dec 2004
(For Beastmaster & others)

Maybe we could set a hotkey to pause WinSpector Spy.
(hit the stop light button)
-buttons, buttons,...
I like to push all the buttons!!!

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
http://www.activevb.... ... ereng.html

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I've uploaded a long list of messages that can be sent from ahk here. Will come in handy to advanced users.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat