This is a pop MessaheBox example, but I don't know how to open fiel
dialog?
shell = Win32API.new('user32','MessageBox',['L', 'P', 'P', 'L'],'I')
shell.Call(0,"hello world","ShadowZ",0)
The signature of this function is:
int MessageBox(
HWND hWnd, // handle to owner window
LPCTSTR lpText, // text in message box
LPCTSTR lpCaption, // message box title
UINT uType // message box style
);
so your call looks correct at first glance. Note that user32.dll
doesn't export a function named "MessageBox". Instead, it exports
"MessageBoxA" and "MessageBoxW". The former handles ASCII strings and
the latter wide strings (i.e. Unicode). When writing C or C++ code,
one includes the appropriate headers that define the name "MessageBox"
as one of those two using a macro. It may be that you need to call
the appropriate version of the function directly if the Win32API
library doesn't handle that for you.