The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: kodekrazy on September 25, 2005, 03:11:39 PM

Title: help with temp files
Post by: kodekrazy on September 25, 2005, 03:11:39 PM
I am not very good with asm yet and i was hoping someone could help me with geting the location of special folders such as cookies or ie history. Your help would be much appreciated. thanks
Title: Re: help with temp files
Post by: comrade on September 25, 2005, 04:24:18 PM
SHGetFolderPath from shell32
Title: Re: help with temp files
Post by: kodekrazy on September 25, 2005, 05:21:41 PM
i looked at it on MSDN but it didn't help much,i am fairly new to asm, if someone could show me how to use it, it would be very helpful. Thanks for your help by the way.
Title: Re: help with temp files
Post by: ToutEnMasm on September 25, 2005, 06:33:51 PM
hello,
A simple example

;declare

;include \masm32\include\advapi32.inc    + lib
;include \masm32\include\shell32.inc       + lib

; define in ShlObj.h
SHGFP_TYPE_CURRENT equ 0
CSIDL_COMMON_DOCUMENTS equ 02eh

;------- data ----
Htoken      dd 0
Chemin    db MAX_PATH + 1 dup (0)
titre db "title",0
;----------- code -----------------------
   invoke GetModuleHandle,NULL
   mov hInstance,eax
   invoke OpenProcessToken,hInstance,TOKEN_READ,addr Htoken
   invoke SHGetFolderPath,NULL,CSIDL_COMMON_DOCUMENTS,Htoken,SHGFP_TYPE_CURRENT,addr Chemin
   
   invoke MessageBox,NULL,ADDR Chemin,addr titre,MB_OK

;---------------------------------------------------------------------------------------------------------------------------------------
                           ToutEnMasm






Title: Re: help with temp files
Post by: kodekrazy on September 25, 2005, 06:36:20 PM
thank you so much that is exactly what i needed.