;============================================================================================================================================= ; step_20.asm ;Get the current path of the special Win folders(e.g. printers,recent...) ; Algorithm ;A1: Get LPITEMIDLIST ;A2: Get the path from the ID ;A3: Show the path ;(C)I don't take any responsibility for the use of this program ; Zedr0n -- connection closed ;============================================================================================================================================= ;============================================================================================================================================= ; Options/Declarations ;============================================================================================================================================= .386 .model flat, stdcall option casemap:none include windows.inc include kernel32.inc include shell32.inc include user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\shell32.lib includelib \masm32\lib\user32.lib ;============================================================================================================================================= ; Data segment ;============================================================================================================================================= .data Caption db "Zedr0n's step #20",0 Err db "Error while getting lpid",0 ;============================================================================================================================================ ; Variables segment ;============================================================================================================================================ .data? lpid LPITEMIDLIST ? path db 256 dup(?) ;============================================================================================================================================= ; Code segment ;============================================================================================================================================= .code start: A1: invoke SHGetSpecialFolderLocation,NULL,CSIDL_RECENT,offset lpid .if lpid==NULL invoke MessageBox,NULL,offset Err,offset Caption,NULL invoke ExitProcess,NULL A2: .else invoke SHGetPathFromIDList,lpid,offset path A3: invoke MessageBox,NULL,offset path,offset Caption,NULL .endif Exit: invoke ExitProcess,NULL end start