[PB4.60 x86,Win7] SendMessage_ or structure is different
Posted: Thu Nov 10, 2011 10:00 pm
Hi, I test code for sending messages to change directories in Total Commander and if I run this code in Purebasic 4.51 then everything works fine, but if I run this code in Purebasic 4.60 then nothing happens. Both versions of Purebasic show me same values in debug mode.
Can You please test it?
My configuration is: Windows 7 Professional 64bit - Czech version, Purebasic 4.51 x86 and Purebasic 4.60 x86
Thanks, Petr
Can You please test it?
My configuration is: Windows 7 Professional 64bit - Czech version, Purebasic 4.51 x86 and Purebasic 4.60 x86
Thanks, Petr
Code: Select all
Global total_hwnd
Procedure EnumWindows ( hwnd, lParam )
window_class.s = Space ( #MAX_PATH + 1 )
GetClassName_( hwnd, @window_class, #MAX_PATH )
If window_class = "TTOTAL_CMD"
text.s = Space ( #MAX_PATH )
text_length = #MAX_PATH
GetWindowText_( hwnd, @text, text_length )
Debug text
total_hwnd = hwnd
ProcedureReturn #False
EndIf
ProcedureReturn #True
EndProcedure
EnumWindows_ ( @EnumWindows(), 0 )
Debug total_hwnd
string2send.s = "c:\windows" + Chr ( 13 ) + "c:\windows\system32"
*stringdata.COPYDATASTRUCT = AllocateMemory ( SizeOf ( COPYDATASTRUCT ) )
With *stringdata
\dwData = Asc("C") + 256 * Asc("D")
\cbData = StringByteLength ( string2send ) + SizeOf ( CHARACTER )
\lpData = @string2send
EndWith
Debug *stringdata\dwData
Debug *stringdata\cbData
Debug string2send
Debug SendMessage_( total_hwnd, #WM_COPYDATA, #Null, *stringdata )