News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Windows plays foul with tooltips_class32

Started by jj2007, January 21, 2011, 01:59:14 PM

Previous topic - Next topic

japheth

Quote from: jj2007 on January 23, 2011, 09:46:29 AM
Special edition for my clever German friend, with an int 3 before the LoadString - to be run with a debugger, obviously.

Ok, thanks! I have to apologize! The updated list looks like this:

1.Japheth did something wrong AND there's a big, fat bug in the Win XP LoadString function
2. JJ is doing something wrong
3. JJ's MasmBasic does something wrong
4. your machine is infected (rather unlikely)

If the string doesn't exist or has size zero, 0 is returned and last error is NOT set. Same happens in Win98.

jj2007

Quote from: qWord on January 23, 2011, 10:33:54 AM
not sure ... but in your exe there is only one resource with the ID=3: an icon - maybe this is the problem. On Win7-x64 LoadString returns zero+ERROR_SUCCESS - so it has load an zero-sized string (icon data)?

Hi qWord,

There is an icon but its ID is 32512. There is also a stringtable, but the requested ID 3 is missing. IMHO a missing string should return an error... and it should not be an obscure error set by CreateWindowEx. But Japheth may have another UHO, of course.

Quote32512 ICON "\\masm32\\RichMasm\\icons\\Globe.ico"   ; Asm, House, Keys, Globe, Hammer, Setup, Disc, Eye, ...
STRINGTABLE
BEGIN
   001,   "Enter text here"         ; e.g. for ToolTips hEdit=wRes$(1+400*MyLanguage)
   002,   "Click on this button"   ; e.g. for wSetWin$ hButton=wRes$(2+400*MyLanguage)
;   003,   "Welcome"
   401,   "Введите текст  здесь"   ; "Enter text here" in Russian
   402,   "Нажмите на эту кнопку"   ; "Click on this button" in Russian
   403,   "Добро пожаловать"   ; "Welcome" in Russian
   801,   "أدخل النص هنا"               ; "Enter text here" in Arabic
   802,   "دفع هذا الزر"                  ; "Click on this button" in Arabic
   803,   "مرحبا بكم"                  ; "Welcome" in Arabic
   1201,   "在這裡輸入文字"      ; "Enter text here" in Chinese
   1202,   "按一下這個按鈕"      ; "Click on this button" in Chinese
   1203,   "歡迎"                     ; "Welcome" in Chinese
;    Try wMsgBox 0, wRes$(402), wChr$("Wow:")
END