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.
Posted on 2002-06-03 11:59:46 by dREAMtHEATER
the real new-style explorer on my XP pro
Posted on 2002-06-03 12:03:52 by dREAMtHEATER
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
Posted on 2002-06-03 12:15:01 by dREAMtHEATER
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:.
Posted on 2002-06-03 12:58:04 by LuHa
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 ?
Posted on 2002-06-04 01:29:38 by smurf
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
Posted on 2002-06-04 09:17:04 by 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.
Posted on 2002-06-04 11:01:39 by smurf
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
Posted on 2002-06-05 06:22:21 by dREAMtHEATER
--------------
The posts infomation deletede by me because I use chinese characters in posts.
--------------
Const.Ex 12/6/2002
Posted on 2002-06-11 05:45:55 by Const.Ex
Hi Const.Ex!

Please use the PM system if you want to communicate in a foreign language.

Thanks!

bAZiK
Posted on 2002-06-11 08:20:06 by bazik
this is twice-The First and last time ~~:grin:
Posted on 2002-06-11 09:26:42 by Const.Ex

this is twice-The First and last time ~~:grin:


Thanks :)
Posted on 2002-06-11 10:01:02 by bazik
use macro IF and ENDIF
[size=9]

OPENFILENAM STRUCT
...
IF (_WIN32_WINNT GE 0500H)
pvReserved DWORD ?
dwReserved DWORD ?
FlagsEx DWORD ?
ENDIF
OPENFILENAME ENDS
[/SIZE]

I haven't test it.
Posted on 2002-06-11 10:18:52 by yoursguideline
Hi yoursguideline
Thanks for ur reply, can u tell me how to apply this option structrue in real code, thanks!

dREAMtHEATER
Posted on 2002-06-11 12:09:21 by 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]
Posted on 2002-06-11 12:26:48 by yoursguideline
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?
Posted on 2002-06-12 09:53:18 by dREAMtHEATER
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.
Posted on 2002-06-12 11:22:55 by yoursguideline
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
Posted on 2002-06-13 09:49:41 by 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.
Posted on 2002-06-13 10:44:58 by yoursguideline
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
Posted on 2002-06-13 23:22:35 by dREAMtHEATER