I use GetSaveFileName API to got save as common dialog, but it is not common save as dialog, I add a hook procedure to it, set structure flag to
mov ofn.Flags, OFN_EXPLORER or OFN_PATHMUSTEXIST or OFN_ENABLEHOOK or OFN_OVERWRITEPROMPT or OFN_HIDEREADONLY or OFN_ENABLETEMPLATE, but i can not get new Explorer-style according to MSDN, remove OFN_ENABLEHOOK
or OFN_ENABLETEMPLATE, and I can get.
mov ofn.Flags, OFN_EXPLORER or OFN_PATHMUSTEXIST or OFN_ENABLEHOOK or OFN_OVERWRITEPROMPT or OFN_HIDEREADONLY or OFN_ENABLETEMPLATE, but i can not get new Explorer-style according to MSDN, remove OFN_ENABLEHOOK
or OFN_ENABLETEMPLATE, and I can get.
the real new-style explorer on my XP pro
I can not figure out the bug I write, it can run happily on all windows platform, but just can not get new- style explorer.
I attach the file, if someone can help me, I'll appreciate for ur help
I attach the file, if someone can help me, I'll appreciate for ur help
Some time ago I posted about a similar problem, but with GetOpenFileName:
http://www.asmcommunity.net/board/index.php?topic=5210
My problem is not yet solved, since I haven't install the PSDK upgrade. Maybe one of next weeks I will make the upgrade... If you find a workaround without SDK installation please let me know :grin:.
http://www.asmcommunity.net/board/index.php?topic=5210
My problem is not yet solved, since I haven't install the PSDK upgrade. Maybe one of next weeks I will make the upgrade... If you find a workaround without SDK installation please let me know :grin:.
hi dREAMtHEATHER,
at these 3 lines to the bottom of your OPENFILENAMEA structure in your windows.inc file and then it will work:
pvReserved DWORD ?
dwReserved DWORD ?
FlagsEx DWORD ?
at these 3 lines to the bottom of your OPENFILENAMEA structure in your windows.inc file and then it will work:
pvReserved DWORD ?
dwReserved DWORD ?
FlagsEx DWORD ?
Hi smurf:
Thanks for u help!:alright: I have another question, the OPENFILENAMEA structure in MSDN like below:
typedef struct tagOFN {
DWORD lStructSize;
HWND hwndOwner;
HINSTANCE hInstance;
LPCTSTR lpstrFilter;
LPTSTR lpstrCustomFilter;
DWORD nMaxCustFilter;
DWORD nFilterIndex;
LPTSTR lpstrFile;
DWORD nMaxFile;
LPTSTR lpstrFileTitle;
DWORD nMaxFileTitle;
LPCTSTR lpstrInitialDir;
LPCTSTR lpstrTitle;
DWORD Flags;
WORD nFileOffset;
WORD nFileExtension;
LPCTSTR lpstrDefExt;
LPARAM lCustData;
LPOFNHOOKPROC lpfnHook;
LPCTSTR lpTemplateName;
#if (_WIN32_WINNT >= 0x0500)
void * pvReserved;
DWORD dwReserved;
DWORD FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)
} OPENFILENAME, *LPOPENFILENAME;
can u tell me how to convert the c-style structure to ASM like, because in this structure contains platform keyword, and how to detect the platform version?
dREAMtHEATER
Thanks for u help!:alright: I have another question, the OPENFILENAMEA structure in MSDN like below:
typedef struct tagOFN {
DWORD lStructSize;
HWND hwndOwner;
HINSTANCE hInstance;
LPCTSTR lpstrFilter;
LPTSTR lpstrCustomFilter;
DWORD nMaxCustFilter;
DWORD nFilterIndex;
LPTSTR lpstrFile;
DWORD nMaxFile;
LPTSTR lpstrFileTitle;
DWORD nMaxFileTitle;
LPCTSTR lpstrInitialDir;
LPCTSTR lpstrTitle;
DWORD Flags;
WORD nFileOffset;
WORD nFileExtension;
LPCTSTR lpstrDefExt;
LPARAM lCustData;
LPOFNHOOKPROC lpfnHook;
LPCTSTR lpTemplateName;
#if (_WIN32_WINNT >= 0x0500)
void * pvReserved;
DWORD dwReserved;
DWORD FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)
} OPENFILENAME, *LPOPENFILENAME;
can u tell me how to convert the c-style structure to ASM like, because in this structure contains platform keyword, and how to detect the platform version?
dREAMtHEATER
OPENFILENAM STRUCT
lStructSize DWORD ?
hwndOwner DWORD ?
hInstance DWORD ?
lpstrFilter DWORD ?
lpstrCustomFilter DWORD ?
nMaxCustFilter DWORD ?
nFilterIndex DWORD ?
lpstrFile DWORD ?
nMaxFile DWORD ?
lpstrFileTitle DWORD ?
nMaxFileTitle DWORD ?
lpstrInitialDir DWORD ?
lpstrTitle DWORD ?
Flags DWORD ?
nFileOffset WORD ?
nFileExtension WORD ?
lpstrDefExt DWORD ?
lCustData DWORD ?
lpfnHook DWORD ?
lpTemplateName DWORD ?
pvReserved DWORD ?
dwReserved DWORD ?
FlagsEx DWORD ?
OPENFILENAME ENDS
to detect which dll version you have you can use dllGetVersion. it a more involved than just using that api call.
Hi smurf:
Maybe u misunderstand my meaning, In C++, After I get the system version, i can got proper size of structure thu setting different platform ID, but in MASM32, I don't know how to do it? in different platform, whether i must write another structure that not include the bottom three line?
dREAMtHEATER
Maybe u misunderstand my meaning, In C++, After I get the system version, i can got proper size of structure thu setting different platform ID, but in MASM32, I don't know how to do it? in different platform, whether i must write another structure that not include the bottom three line?
dREAMtHEATER
--------------
The posts infomation deletede by me because I use chinese characters in posts.
--------------
Const.Ex 12/6/2002
The posts infomation deletede by me because I use chinese characters in posts.
--------------
Const.Ex 12/6/2002
Hi Const.Ex!
Please use the PM system if you want to communicate in a foreign language.
Thanks!
bAZiK
Please use the PM system if you want to communicate in a foreign language.
Thanks!
bAZiK
this is twice-The First and last time ~~:grin:
this is twice-The First and last time ~~:grin:
Thanks :)
use macro IF and ENDIF
I haven't test it.
[size=9]
OPENFILENAM STRUCT
...
IF (_WIN32_WINNT GE 0500H)
pvReserved DWORD ?
dwReserved DWORD ?
FlagsEx DWORD ?
ENDIF
OPENFILENAME ENDS
[/SIZE]
I haven't test it.
Hi yoursguideline
Thanks for ur reply, can u tell me how to apply this option structrue in real code, thanks!
dREAMtHEATER
Thanks for ur reply, can u tell me how to apply this option structrue in real code, thanks!
dREAMtHEATER
ok the following code is complete. Since i am using macro IF and ENDIF, the struct will be preprocessed before complied.
[size=9]
OPENFILENAM STRUCT
lStructSize DWORD ?
hwndOwner DWORD ?
hInstance DWORD ?
lpstrFilter DWORD ?
lpstrCustomFilter DWORD ?
nMaxCustFilter DWORD ?
nFilterIndex DWORD ?
lpstrFile DWORD ?
nMaxFile DWORD ?
lpstrFileTitle DWORD ?
nMaxFileTitle DWORD ?
lpstrInitialDir DWORD ?
lpstrTitle DWORD ?
Flags DWORD ?
nFileOffset WORD ?
nFileExtension WORD ?
lpstrDefExt DWORD ?
lCustData DWORD ?
lpfnHook DWORD ?
lpTemplateName DWORD ?
IF (_WIN32_WINNT GE 0500H)
pvReserved DWORD ?
dwReserved DWORD ?
FlagsEx DWORD ?
ENDIF
OPENFILENAME ENDS
[/SIZE]
Hi yoursguideline:
The real code do not designate the complete OPENFILENAME sturcture, I wanna got the code that how to get correct sizeof in asm code.
i write part of code:
mov osvinfo.dwOSVersionInfoSize, sizeof osvinfo
invoke GetVersionEx, addr osvinfo
.IF (osvinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvinfo.dwMajorVersion == 5)
; get sizeof OPENFILENAME (_WIN32_WINNT ==5)
.ELSE
; get OPENFILENAME (sizeof _WIN32_WINNT ==4)
.ENDIF
I don't know the comment line code syntax, can u give me a instruction?
The real code do not designate the complete OPENFILENAME sturcture, I wanna got the code that how to get correct sizeof in asm code.
i write part of code:
mov osvinfo.dwOSVersionInfoSize, sizeof osvinfo
invoke GetVersionEx, addr osvinfo
.IF (osvinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvinfo.dwMajorVersion == 5)
; get sizeof OPENFILENAME (_WIN32_WINNT ==5)
.ELSE
; get OPENFILENAME (sizeof _WIN32_WINNT ==4)
.ENDIF
I don't know the comment line code syntax, can u give me a instruction?
sizeof OPENFILENAME will be the correct structure size. You do not need to get the size of the structure in the conditional way. You can try as follows:
mov eax, sizeof OPENFILENAME
If the defined _WIN32_WINNT value is greater than 0500h, the value of eax is 88 bytes, otherwise, the value of eax is 76 bytes
The OPENFILENAME structure is preprocessed first and the structure is designated completely.
Ask if you don't understand.
mov eax, sizeof OPENFILENAME
If the defined _WIN32_WINNT value is greater than 0500h, the value of eax is 88 bytes, otherwise, the value of eax is 76 bytes
The OPENFILENAME structure is preprocessed first and the structure is designated completely.
Ask if you don't understand.
Hi! yoursguideline:
I use GetVersionEx to get the correct size of OPENFILENAME, because I wanna my program can run on all Windows platform, but in win9x series platform, u must set the size of OPENFILENAME 76 bytes, and on win2k/XP should set to 88 bytes, so I must test the version of Windows, but I don't wanna manualy calculate the size of OPENFILENAME, how I can auomatcally get size of OPENFILENAME on different platform?
dREAMtHEATER
I use GetVersionEx to get the correct size of OPENFILENAME, because I wanna my program can run on all Windows platform, but in win9x series platform, u must set the size of OPENFILENAME 76 bytes, and on win2k/XP should set to 88 bytes, so I must test the version of Windows, but I don't wanna manualy calculate the size of OPENFILENAME, how I can auomatcally get size of OPENFILENAME on different platform?
dREAMtHEATER
Quote from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo_49iw.asp
Before calling the GetVersionEx function, set the dwOSVersionInfoSize member of the OSVERSIONINFO data structure to sizeof(OSVERSIONINFO).
Windows NT 4.0 SP6 and later: This member can be a pointer to an OSVERSIONINFOEX structure. Set the dwOSVersionInfoSize member to sizeof(OSVERSIONINFOEX) to identify the structure type.
Before calling the GetVersionEx function, set the dwOSVersionInfoSize member of the OSVERSIONINFO data structure to sizeof(OSVERSIONINFO).
Windows NT 4.0 SP6 and later: This member can be a pointer to an OSVERSIONINFOEX structure. Set the dwOSVersionInfoSize member to sizeof(OSVERSIONINFOEX) to identify the structure type.
yoursguideline:
Hi! Maybe my English is too bad, so can u help me write code to demonstrate the usage of OPENFILENAME, it can run on all Windows platform, but in 2k/XP platform, it can get extra style according to my posted picture style, not manualy calculate the size of OPENFILENAME
dREAMtHEATER
Hi! Maybe my English is too bad, so can u help me write code to demonstrate the usage of OPENFILENAME, it can run on all Windows platform, but in 2k/XP platform, it can get extra style according to my posted picture style, not manualy calculate the size of OPENFILENAME
dREAMtHEATER