Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/14/2022 in all areas

  1. The last rc seemed stable - will be releasing that and then moving onto new betas with other fixes. 3.3.16.0 had a fairly nasty RegExp bug and I really want to get that fixed.
    8 points
  2. From winuser.h /* * Dialog Box Command IDs */ #define IDOK 1 #define IDCANCEL 2 #define IDABORT 3 #define IDRETRY 4 #define IDIGNORE 5 #define IDYES 6 #define IDNO 7 #if(WINVER >= 0x0400) #define IDCLOSE 8 #define IDHELP 9 #endif /* WINVER >= 0x0400 */ Windows button controls for OK and Cancel are usually 1 and 2 and IIRC mapped to Enter (Default) and Esc (Cancel) - the rest of them don't come into play in a custom dialog. We could have just picked 100 to be honest and made it all the more cryptic
    1 point
  3. From the source: // Limits #define AUT_GUI_FIRSTCONTROL 3 // First usable control ID (1 (IDOK) and 2 (IDCANCEL) is used by the OS and 0 is not used) #define AUT_GUI_MAXCONTROLID 65535 // Maximum control ID - limited to WORD size (unsigned short) Obviously caused a clash in an early build. Lots of 1 and 2 used by the OS so we just picked the first free one.
    1 point
  4. Glad you found the solution. Yes I've had a similar issue and added comment notes at the time in one of my scripts : GUIDelete($hGUI_Preview) ; delete the window (the handle $hGUI_Preview still contains a pointer, these are 2 different points) $hGUI_Preview = 0 ; force the variable (handle) $hGUI_Preview to 0, then it's not a pointer any more but an Int32 variable. ; It's the same principle with plenty of other functions, for example _GDIPlus_ImageDispose($hImage)  ; which frees memory, but their handle still contains its value AFTER _GDIPlus_ImageDispose($hImage) ; When needed, it's the programmer's job to empty the variable ($hImage = 0 or $hGUI_Preview = 0) making sure ; the variable is no more a handle (pointer) but an Int32 variable, as VarGetType() would reflect it. ; Only then, a test such as If $hGUI_Preview Then... will make sense, no matter its place in the script. Edit: I got additional comments placed at the beginning of the script. Gonna add them below in case it may help a user facing the same problem : Global $hGUI_Preview = 0 #cs Note: it's a good thing to initialize all Global handles to 0 : it would avoid (for instance) an error during tests like "If WinExists($hGUI_Preview) Then..." on an untitled undefined window. Don't forget that a variable defined with "Global $hGUI_Preview" creates a STRING variable and then a test like If WinExists("") would return 1 (success) which is a bad thing in this case, while If WinExists(0) would return 0 (failure) and this is what we need. That explains why $hGUI_Preview = 0 has to be placed immediately after GUIDelete($hGUI_Preview) in the script, it's done ! It's VERY important to force $hGUI_Preview = 0 just after GUIDelete($hGUI_Preview) as we intend to use tests like "If WinExists($hGUI_Preview) Then..." or "If $hGUI_Preview Then..." anywhere in the script. #ce
    1 point
×
×
  • Create New...