I have a ton of desktop shortcuts and a ton of folders of such.. So, The project I'm working on is a startup program trayicon.. Which will have menus for organization of computer programs and folders. I will also include fast searching capabilities.
I was using a window before this and it was working perfectly...
However, Making each and every window is too troublesome for me so... Im trying to use a dialogbox for this. However, now it seems to be in a loop which I can't figure it how to fix.
I was using a window before this and it was working perfectly...
However, Making each and every window is too troublesome for me so... Im trying to use a dialogbox for this. However, now it seems to be in a loop which I can't figure it how to fix.
;=======================================================================
format PE GUI 4.0
;format PE CONSOLE
;=======================================================================
include '%fasminc%\win32ax.inc'
include 'databaseengine.inc'
;=======================================================================
entry start
WUM_SHELLNOTIFY equ WM_USER + 5
MI_RESTORE equ 3000
MI_CREATE equ 3001
MI_EXIT equ 3002
MI_EXECUTE equ 3003
SBI_TRAY equ 3004
textb equ 102h
buttonb equ 101h
MAINDLG equ 100
IDI_ICON equ 9000
;MACORS_________________________________________________________
macro @GetModuleHandle
{
mov eax,dword ; API : GetModuleHandleA
mov eax,dword ;---------------
mov eax,dword ;--------------------
}
macro @GetLastError
{
mov eax,dword ; API : GetLastError----------
mov eax,dword ;--------------------------
}
macro @GetTickCount
{
MOV EDX,7FFE0000h
MOV EAX,DWORD
MUL DWORD
SHRD EAX,EDX,18
}
macro @GetAppName
{
MOV EAX,
MOV EAX,
MOV EAX,
}
macro @GetCurrentThread
{
MOV EAX,dword
MOV EAX,dword
}
macro @sysenter syscall,
{
local blah1,blah2
push eax
jmp blah2
blah1:
mov eax, syscall
mov edx, esp
dw 340Fh ;sysenter 0F34h
blah2:
call blah1
add esp, (parameters*4) + 4 ; + 1 dummy EIP
}
macro Sysinvoke proc,
{ common
local blah1,blah2,param_count
param_count=0
reverse
pushd parameters
param_count=param_count+1
common
push eax
jmp blah2
blah1:
mov eax, proc
mov edx, esp
dw 340Fh ;sysenter 0F34h
blah2:
call blah1
add esp, (param_count * 4) + 4 ; + 1 dummy EIP
}
;DATA______________________________________________________________________________________
section '.data' data readable writeable
gIst dd ?
wndH dd ?
insH dd ?
wndClsName db 'TUT_23',0
wndTitle db 'Tutorial 23',0
texthd dd ?
buttond dd ?
wndCls WNDCLASS
wndMsg MSG
texth db 'EDIT',0
buttonh db 'BUTTON',0
menuH dd ?
menuPt POINT
menuRect RECT
miCreate db '&Create',0
miExecute db '&Execute',0
miRESTORE db '&Restore',0
miEXIT db '&Exit',0
executed db 'C:\Documents and Settings\Owner\Desktop\flatpe.exe',0
statBarData NOTIFYICONDATA
sinfo STARTUPINFO
datahandle dd 0
buffer rb 20h
bufin dd 40 dup (?)
bufin2 dd 40 dup (?)
databytes rb 20h
byteread dd ?
database db "hello",0
pinfo PROCESS_INFORMATION
shi db "%d",0
shi1 db "%s",0
section '.data1' data readable writeable
datastart equ $
phandle dd 0
mhandle dd 0
fhandle dd 0
range dd ?
;CODE_________________________________________________________________________________________________________
section '.code' code readable executable
proc start1
@GetModuleHandle
mov ,eax
invoke InitCommonControls
invoke DialogBoxParam,eax,MAINDLG,0,DlgProc,0
invoke ExitProcess,0
endp
;+----------------------+
;| the dialog procedure |
;+----------------------+
proc DlgProc,hWnd,uMsg,wParam,lParam
push ebx esi edi
.if ,e,WM_INITDIALOG
invoke SendMessage,,WM_COMMAND,MI_RESTORE,0
invoke LoadIcon,,IDI_ICON
invoke SendMessage,,WM_SETICON,TRUE,eax
jmp wmBYE
.elseif ,e,WUM_SHELLNOTIFY
cmp ,SBI_TRAY
jne wmBYE
cmp ,WM_RBUTTONDOWN
je wumSHELLNOTIFY_WM_RBUTTONDOWN
cmp ,WM_LBUTTONDBLCLK
je wumSHELLNOTIFY_WM_LBUTTONDBLCLK
jmp wmBYE
.elseif ,e,WM_COMMAND
cmp ,0
jne wmBYE
mov eax,
cmp ax,MI_RESTORE
je wmCOMMAND_MI_RESTORE
cmp ax,MI_EXECUTE
je wmCOMMAND_MI_EXECUTE
cmp ax,MI_CREATE
je wmCOMMAND_MI_CREATE
cmp ax,MI_EXIT
je wmCOMMAND_MI_EXIT
Sysinvoke DEstroyWindow,
jmp wmBYE
.elseif ,e,WM_SIZE
cmp ,SIZE_MINIMIZED
jne wmBYE
mov ,sizeof.NOTIFYICONDATA
push
pop
mov ,SBI_TRAY
mov ,NIF_ICON + NIF_MESSAGE + NIF_TIP
mov ,WUM_SHELLNOTIFY
invoke LoadIcon,,IDI_ICON
mov ,eax
invoke lstrcpy,statBarData.szTip,wndTitle
Sysinvoke SHowWindow,,SW_HIDE
invoke Shell_NotifyIcon,NIM_ADD,statBarData
jmp wmBYE
.elseif ,e,WM_CREATE
invoke CreatePopupMenu
mov ,eax
invoke AppendMenu,,MF_STRING,MI_EXECUTE,miExecute
invoke AppendMenu,,MF_STRING,MI_RESTORE,miRESTORE
invoke AppendMenu,,MF_STRING,MI_CREATE,miCreate
invoke AppendMenu,,MF_STRING,MI_EXIT,miEXIT
jmp wmBYE
.elseif ,e,WM_CLOSE
;invoke OutputDebugString,crap
invoke EndDialog,,0
.endif
wumSHELLNOTIFY_WM_LBUTTONDBLCLK:
invoke SendMessage,,WM_COMMAND,MI_RESTORE,0
jmp wmBYE
wumSHELLNOTIFY_WM_RBUTTONDOWN:
Sysinvoke GETCursorPos,menuPt,026h
Sysinvoke SEtForegroundWindow,
invoke TrackPopupMenu,,TPM_RIGHTALIGN + TPM_RIGHTBUTTON,\
,,NULL,,NULL
invoke PostMessage,,WM_NULL,0,0
jmp wmBYE
wmCOMMAND_MI_EXECUTE:
invoke CreateProcessInternal,0,0,executed,0,0,FALSE,NORMAL_PRIORITY_CLASS,0,0,sinfo,pinfo,0
jmp wmBYE
wmCOMMAND_MI_CREATE :
mov ebx,255
stdcall CreateDatabase,wndTitle,ebx
jmp wmBYE
wmCOMMAND_MI_RESTORE:
invoke Shell_NotifyIcon,NIM_DELETE,statBarData
Sysinvoke SHowWindow,,SW_RESTORE
jmp wmBYE
wmCOMMAND_MI_EXIT:
invoke Shell_NotifyIcon,NIM_DELETE,statBarData
invoke ExitProcess,0
wmDESTROY:
Sysinvoke DEstroyMenu,
invoke Shell_NotifyIcon,NIM_DELETE,statBarData
Sysinvoke POstQuitMessage,0,33h
wmBYE:
pop edi esi ebx
ret
endp
start:
call start1
;IMPORTS__________________________________________________________________________________________________
section '.idata' import data readable writeable
library kernel32,'KERNEL32.DLL',\
user32, 'USER32.DLL',\
comdlg32,'COMDLG32.DLL',\
ole32, 'OLE32.DLL',\
ntdll, 'NTDLL.DLL',\
shell32, 'SHELL32.DLL',\
advapi32, 'ADVAPI32.DLL',\
comctl32, 'comctl32.dll'
;-----------------------------------------------------------------------
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\kernel32.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\ntdll.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\user32.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\comdlg32.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\ole32.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\shell32.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\advapi32.inc'
include 'C:\WinAsm\Assemblers\fasm\INCLUDE\APIA\comctl32.inc'
;=======================================================================
section '.rsrc' resource from 'res1.res' data readable