../Msgboard/Modding your system/How to determine which control number runs which action?Home
DeofMovestofca - 28 Aug. 2008 - 21:05:

How to determine which control number runs which action?

Perhaps the best way to ask this question is through an example. The controls for the "Run" dialog (shell32.dll, dialog 1003) are:
" CONTROL 160, 12297, STATIC, SS_ICON | WS_CHILD | WS_VISIBLE, 7, 11, 18, 20
CONTROL "Type the name of a program, folder, document, or Internet resource, and Windows will open it for you.", 12289, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 36, 11, 182, 18
CONTROL "&Open:", 12305, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 7, 39, 24, 10
CONTROL "", 12298, COMBOBOX, CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 36, 37, 183, 200
CONTROL "Run in separate &memory space", 12306, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 36, 51, 183, 10
CONTROL "OK", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 62, 70, 50, 14
CONTROL "Cancel", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 116, 70, 50, 14
CONTROL "&Browse...", 12288, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 170, 70, 50, 14 ", the last six of which perform some type of action. I'm assuming that it isn't the text of the action ("&Open:", none, "Run in separate &memory space", "OK", "Cancel" and "&Browse...", but the number following the text (12305, 12298, 12306, 1, 2, and 12288) that determines which action selecting that control will perform. However, I've been unable to figure out how the dialog boxes determine which action matches up with which number. Is the only way to obtain such data is to go through every .exe, .dll, etc. and make a list of them? If so, does anyone here if someone's already done this and made such a list available on the internet? While I would agree that for most actions there probably aren't any practical reasons to add them to any dialog box that doesn't have them, but I think it might be helpful to have an "apply"-like button on the run dialog that would start a program without closing the run dialog if one had several programs one wanted to start at the same time without having to re-open the dialog several times or to have a clock and/or calendar on the start menu and/or logon dialog (without having to search through .exe's, .dll's, etc. to find the required control number every time I wanted to add a control). Or one could switch the "Ok" and "Shutdown" numbers on the logon screen to see how long it takes for others to figure out why the computer seems to keep wanting to shutdown every tiime they try to log on. :P)
 
28 Aug. 2008 - 22:20 Serenity
CONTROL "&Browse...", 12288, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 170, 70, 50, 14

These numbers (12288 in above) are WM_COMMAND messages. You can also obtain them with Winspector. The rest are styles applied to the control, and the last set of numbers are the dimensions and coordinates for positioning in the gui. :)
 
29 Aug. 2008 - 19:48 DeofMovestofca
"The rest are styles applied to the control, and the last set of numbers are the dimensions and coordinates for positioning in the gui."

Yeah, these two parts I already understood, but thanks anyway. I'd rather people give me information that they think I need, but don't than not give me information that they think I don't need, but do.:)

"You can also obtain them with Winspector."

It took me awhile before I finally figured out how to get the command IDs from Winspector, although that solution is sort of like using a bazooka to kill a fly. :P Except that I just noticed (I is getting smarter every day!) that for "SysMonthCal32" that reshack automatically adds the ID 711 (Slurpee, anyone?:)). So, let me try for the TrayClockWClass, whose ID is 303, Styles are WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS and StylesEx (making sure we capitalize the second "E" in "StylesEx" :P) are WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR. Fire up reshacker, find the dialog I want to add a clock to, "Insert control" and... get stuck. My first guess is that I want to choose the "Static" pre-defined control, but that doesn't show the "WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR" StylesEx. About the fifteenth guess, I figure I have to add it manually, so I'll try:
CONTROL "", 303, "TrayClockWClass", WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, 150, 150, 100, 14
which leaves me a nice gray space in the middle of my dialog box because I'm assuming that reshacker doesn't recognize the "TrayClockWClass" control (that is, if one actually exists). Otherwise, I've hit a dead end, in which case I'd appreciate it if someone could point me to which control type I should use instead (or at least how I can find such information)....
 
06 Jul. 2009 - 17:33 bal98er
i haven't found a way to even remember those ids. at least not yet. but i did find out one thing though. the ids are definitely unique for each app. the trayclockwclass control is not built into any dll but into systray.exe, which can't be resedited. when the taskbar is right-clicked, and the start menu customized to show the "clock", explorer just calls on the relevant hook to set the 'visible' property 1 or 0.

this is not microsoft logic. this is what i've understood trying to figure it out. i may be wrong. i'd appreciate any inputs. thanx.
 
Please log-in to post.
You need to be logged in to post. To log-in, or to register an account go -there.
 
Options
Login | Help | Profile | User list | Display last  
 days 


../Msgboard/Modding your system/How to determine which control number runs which action?Top

xhtml 1.1