{"id":209,"date":"2019-06-20T17:58:52","date_gmt":"2019-06-20T17:58:52","guid":{"rendered":"https:\/\/delphijustin.biz\/?p=209"},"modified":"2021-10-13T20:22:11","modified_gmt":"2021-10-14T01:22:11","slug":"window-hacker","status":"publish","type":"post","link":"https:\/\/delphijustin.biz\/window-hacker\/","title":{"rendered":"Window Hacker"},"content":{"rendered":"\n<div class=\"Section1\">\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">This program is a\ngreat tool to have. It allows you to take control of<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">window controls\nand their handles. This is like Spy++ but free. Theres<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">a dll that allows\nyou to control a window from a batch file just use <\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">rundll32 with it\nlike<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">&nbsp;<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">rundll32 libwndhack.dll,CloseHWND\nsearch_query<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">rundll32\nlibwndhack.dll,ShowHWND search_query<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">rundll32\nlibwndhack.dll,ClickButton search_query<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">rundll32\nlibwndhack.dll,EnableHWND search_query<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">rundll32\nlibwndhack.dll,DisableHWND search_query<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">&nbsp;<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">The search_query\nis the string that will be searched for.<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">&nbsp;<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">Here\u2019s a\nscreenshot of the program:<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\"><img decoding=\"async\" loading=\"lazy\" id=\"Picture 0\" src=\"\/wp-content\/imports\/wndhacker.jpg\" alt=\"wndhacker.jpg\" width=\"625\" height=\"334\"><\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">&nbsp;<\/span><\/p>\n\n<p class=\"MsoPlainText\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style=\"font-family:&quot;Courier New&quot;\">&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;More\ntools and apps avaliable at<\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"http:\/\/www.delphijustin.biz\">www.delphijustin.biz<\/a><\/span><\/p>\n\n<p class=\"MsoPlainText\"><span style=\"font-family:&quot;Courier New&quot;\">&nbsp;<\/span><\/p>\n\n<\/div>\n\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">unit wndhackUnit1;\n{$RESOURCE wndhack32.res}\ninterface\n\/\/Main window unit\nuses\n  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,\n  Menus, StdCtrls, ExtCtrls,shellapi, ComCtrls, ScktComp, Spin;\n\ntype\n  TWNDHacker = class(TForm)\n    Panel1: TPanel;\n    Label1: TLabel;\n    HWNDEdit: TEdit;\n    Label2: TLabel;\n    Button1: TButton;\n    Label3: TLabel;\n    cname: TEdit;\n    WNDEn: TCheckBox;\n    WNDV: TCheckBox;\n    Label4: TLabel;\n    WNDTxt: TMemo;\n    MainMenu1: TMainMenu;\n    UpdateList1: TMenuItem;\n    HWNDIcon: TPaintBox;\n    GroupBox1: TGroupBox;\n    ComboBox1: TComboBox;\n    Label5: TLabel;\n    Label6: TLabel;\n    Edit1: TEdit;\n    Label7: TLabel;\n    Edit2: TEdit;\n    Button2: TButton;\n    CheckBox1: TCheckBox;\n    Button3: TButton;\n    Label8: TLabel;\n    Memo1: TMemo;\n    Label9: TLabel;\n    Edit3: TEdit;\n    Label10: TLabel;\n    Edit4: TEdit;\n    ListBox1: TListBox;\n    Label11: TLabel;\n    Edit5: TEdit;\n    Label12: TLabel;\n    Edit6: TEdit;\n    GroupBox2: TGroupBox;\n    Label13: TLabel;\n    ComboBox2: TComboBox;\n    CheckBox2: TCheckBox;\n    Button4: TButton;\n    Help1: TMenuItem;\n    AboutWindowHacker1: TMenuItem;\n    HWNDP: TComboBox;\n    ComboBox3: TComboBox;\n    Label14: TLabel;\n    Tools1: TMenuItem;\n    FindWindow1: TMenuItem;\n    FindDialog1: TFindDialog;\n    OpenDialog1: TOpenDialog;\n    MouseFollower1: TMenuItem;\n    Timer1: TTimer;\n    StatusBar1: TStatusBar;\n    ViewAtomTable1: TMenuItem;\n    PopupMenu1: TPopupMenu;\n    SaveIcon1: TMenuItem;\n    LoadIcon1: TMenuItem;\n    Cancel1: TMenuItem;\n    SaveDialog1: TSaveDialog;\n    RestoreWindow1: TMenuItem;\n    ShowWindow1: TMenuItem;\n    GetWindowLong1: TMenuItem;\n    Label15: TLabel;\n    SpinEdit1: TSpinEdit;\n    Label16: TLabel;\n    SpinEdit2: TSpinEdit;\n    Label17: TLabel;\n    SpinEdit3: TSpinEdit;\n    SpinEdit4: TSpinEdit;\n    Label18: TLabel;\n    Button5: TButton;\n    CheckBox3: TCheckBox;\n    FindWindowEx1: TMenuItem;\n    procedure UpdateList1Click(Sender: TObject);\n    procedure ListBox1Click(Sender: TObject);\n    procedure HWNDIconPaint(Sender: TObject);\n    procedure FormCreate(Sender: TObject);\n    procedure Button1Click(Sender: TObject);\n    procedure Button2Click(Sender: TObject);\n    procedure WNDVClick(Sender: TObject);\n    procedure WNDEnClick(Sender: TObject);\n    procedure Button3Click(Sender: TObject);\n    procedure Button4Click(Sender: TObject);\n    procedure Label12Click(Sender: TObject);\n    procedure ComboBox2Change(Sender: TObject);\n    procedure Label2Click(Sender: TObject);\n    procedure AboutWindowHacker1Click(Sender: TObject);\n    procedure FindDialog1Find(Sender: TObject);\n    procedure FindWindow1Click(Sender: TObject);\n    procedure MouseFollower1Click(Sender: TObject);\n    procedure Timer1Timer(Sender: TObject);\n    procedure ViewAtomTable1Click(Sender: TObject);\n    procedure SaveIcon1Click(Sender: TObject);\n    procedure HWNDIconClick(Sender: TObject);\n    procedure RestoreWindow1Click(Sender: TObject);\n    procedure LoadIcon1Click(Sender: TObject);\n    procedure ShowWindow1Click(Sender: TObject);\n    procedure GetWindowLong1Click(Sender: TObject);\n    procedure Button5Click(Sender: TObject);\n    procedure FindWindowEx1Click(Sender: TObject);\n  private\n    { Private declarations }\n  public\n    { Public declarations }\n  end;\n{  THWNDPPacket=record  Reserved for Remote controllu\n\n  op:integer;\n  Handle:hwnd;\n  classname,windowname:array[0..255]of ansichar;\n  msg,startms,cms:dword;\n  wparam,lparam:lparam;\n  Return:LRESULT;\n  end;           }\n  function GetConsoleWindow:hwnd;stdcall;external 'kernel32.dll';\nvar\n  WNDHacker: TWNDHacker;\n  hico:hicon;\n  nochange:boolean;\n  searchres,msgs,winstyles,shows,gwl:tstringlist;\n  childenum:tlist;\nimplementation\n\n{$R *.DFM}\n\nuses wndhackunit2;\n\nfunction EnumHWND(hw:hwnd;lp:lparam):bool;stdcall;\nvar cname,wtxt:array[0..1024] of char;\npid:dword;\nbegin\ngetwindowtext(hw,wtxt,1025);\ngetclassname(hw,cname,1025);\nresult:=true;\n GEtWindowThreadProcessId(hw,@pid);\n if pid=getcurrentprocessid then exit;\nwndhacker.ListBox1.Items.AddObject(StrPas(CName)+','+strpas(wtxt),TObject(hw));\nwndhacker.HWNDP.Items.Add('$'+inttohex(hw,0));\nif lp=0 then\nenumchildwindows(hw,@enumhwnd,1);\nend;\n\nprocedure TWNDHacker.UpdateList1Click(Sender: TObject);\nbegin\nlistbox1.Items.Clear;\nchildenum.Clear;\nhwndp.Items.Clear;\nlistbox1.Items.AddObject('HWND_DESKTOP',TObject(getdesktopwindow));\nenumwindows(@enumhwnd,0);\nend;\n\nprocedure AddConsts(combo:tcombobox; slConsts:tstringlist);\nvar i:integer;\nbegin\nfor i:=0 to slConsts.Count-1 do\nif StrToInt64Def(slconsts.values[slconsts.names[i]],-1)>-1 then\ncombo.Items.Add(slConsts.names[i]);\nend;\n\nprocedure TWNDHacker.ListBox1Click(Sender: TObject);\nvar classname:array[0..255] of char;\nwindowtxt:pchar;\nwtlen:integer;\nr:trect;\ndwprocess:dword;\nbegin\nnochange:=true;\nHWNDEdit.Text:='$'+IntToHex(HWnd(listbox1.items.objects[listbox1.ItemIndex]),0);\nhwndp.Text:='$'+inttohex(getparent(hwnd(listbox1.items.objects[listbox1.ItemIndex])),0);\nhico:=GetClassLong(hwnd(ListBox1.items.objects[listbox1.itemindex]),GCL_HICON);\nif hico=0 then\nhico:=GetClassLong(getparent(hwnd(listbox1.items.objects[listbox1.itemindex])),\ngcl_hicon);\nif hico=0then hico:=loadicon(0,IDI_APPLICATION);\ndrawicon(hwndicon.canvas.handle,0,0,hico);\nedit5.Text:='$'+inttohex(globalfindatom(classname),4);\nedit3.Text:=inttostr(GetWindowThreadProcessID(strtoint(hwndedit.text),\n@dwprocess));\nedit4.Text:=inttostr(dwprocess);\nedit6.Text:=IntTohex(getwindowlong(strtoint(hwndedit.text),gwl_style),8)+'-'+\ninttohex(getwindowlong(strtoint(hwndedit.text),gwl_exstyle),8);\ngetclassname(hwnd(listbox1.items.objects[listbox1.itemindex]),classname,256);\ncname.Text:=strpas(classname);\nWtlen:=GetWindowTextLength(hwnd(listbox1.items.objects[listbox1.itemindex]))+1;\nwindowtxt:=stralloc(wtlen);\nGetWindowText(hwnd(listbox1.items.objects[listbox1.itemindex]),windowtxt,wtlen);\nwnden.Checked:= iswindowenabled(hwnd(listbox1.items.objects[listbox1.ItemIndex]));\nwndv.Checked:= iswindowvisible(hwnd(listbox1.items.objects[listbox1.itemindex]));\nwndtxt.Text:=strpas(windowtxt);\nstrdispose(windowtxt);\ngetwindowrect(strtoint(hwndedit.text),r);\nspinedit1.Value:=r.Bottom;\nspinedit2.Value:=r.Right;\nspinedit3.Value:=r.Top;\nspinedit4.Value:=r.Left;\nnochange:=false;\nend;\n\nprocedure TWNDHacker.HWNDIconPaint(Sender: TObject);\nbegin\ndrawicon(HWNDIcon.Canvas.handle,0,0,hico);\nend;\n\nprocedure TWNDHacker.FormCreate(Sender: TObject);\nvar i:integer;\nmsgr:tresourcestream;\nstylesr,showr,gwlr:tresourcestream;\nbegin\nsearchres:=tstringlist.Create;\nshows:=tstringlist.Create;\nshowr:=tresourcestream.Create(hinstance,'SHOW','TXT');\nshows.LoadFromStream(showr);\nshowr.Free;\ngwlr:=tresourcestream.Create(hinstance,'GWL','TXT');\ngwl:=tstringlist.Create;\ngwl.LoadFromStream(gwlr);\ngwlr.Free;\nchildenum:=tlist.Create;\ncombobox3.ItemIndex:=0;\nhico:=loadicon(0,IDI_APPLICATION);\nmsgr:=tresourcestream.Create(hinstance,'MESSAGES','TXT');\nmsgs:=tstringlist.Create;\nmsgs.LoadFromStream(msgr);\nmsgr.Free;\nstylesr:=tresourcestream.Create(hinstance,'WINSTYLES','TXT');\nwinstyles:=tstringlist.Create;\nwinstyles.LoadFromStream(stylesr);\nstylesr.Free;\naddconsts(combobox2,winstyles);\nfor i:= 0 to msgs.Count-1 do\nif(msgs.Names[i]&lt;>'') and(strscan(pchar(msgs[i]),'{')=nil) then\ncombobox1.Items.Add(msgs.Names[i]);\napplication.Title:=caption;\nUpdateList1.Click;\nend;\n\nprocedure TWNDHacker.Button1Click(Sender: TObject);\nbegin\nwindows.SetParent(strtoint(hwndedit.text),strtoint(hwndp.text));\nend;\n\nprocedure MyWndMsgProc(hw:hwnd;msg:uint;Startms:DWORD;lres:lresult);stdcall;\nbegin\nwndhacker.Memo1.Lines.Add(IntToHex(hw,0)+' replied within '+inttostr(\ngettickcount-startms)+'ms, returned '+inttohex(lres,0));\nend;\n\nprocedure TWNDHacker.Button2Click(Sender: TObject);\nvar b:boolean;\nhw:hwnd;\nres:lresult;\nbegin\nb:=true;\nres:=0;\nmemo1.Clear;\nif not checkbox1.Checked then\nhw:=strtoint(hwndedit.text)else hw:=hwnd_broadcast;\ncase combobox3.ItemIndex of\n0:b:=sendmessagecallback(hw,strtointdef(msgs.values[combobox1.text],\nregisterwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),\nstrtoint(edit2.text),@mywndmsgproc,gettickcount);\n1:b:=PostMessage(hw,strtointdef(msgs.values[combobox1.text],\nregisterwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),\nstrtoint(edit2.text));\n2:res:=defwindowproc(hw,strtointdef(msgs.values[combobox1.text],\nregisterwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),strtoint(\nedit2.text));\n3:res:=sendmessage(hw,strtointdef(msgs.values[combobox1.text],\nregisterwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),strtoint(\nedit2.text));\nend;\nif not b then\nmessagebox(handle,pchar(syserrormessage(getlasterror)),'Window Hacker',mb_iconerror);\nif res&lt;>0 then memo1.Text :='Returned with '+inttohex(res,0);\nend;\n\nprocedure TWNDHacker.WNDVClick(Sender: TObject);\nbegin\nif nochange then exit;\nif wndv.Checked then\nshowwindow(strtoint(hwndedit.text),sw_show)else\nshowwindow(strtoint(hwndedit.Text),sw_hide);\n\nend;\n\nprocedure TWNDHacker.WNDEnClick(Sender: TObject);\nbegin\nif nochange then exit;\nenablewindow(strtoint(hwndedit.text),wnden.checked);\n\nend;\n\nprocedure TWNDHacker.Button3Click(Sender: TObject);\nbegin\nsetwindowtext(strtoint(hwndedit.text),pchar(wndtxt.text));\nend;\n\nprocedure TWNDHacker.Button4Click(Sender: TObject);\nvar hw:hwnd;\nx:integer;\nbegin\nhw:=strtoint(hwndedit.text);\nif winstyles.Values[combobox2.Text]&lt;>''then\nx:=Strtoint(winstyles.values[combobox2.text])else\nx:=strtoint(combobox2.text);\nif pos('_EX_',Uppercase(combobox2.text))>0 then\nbegin\nif checkbox2.Checked then\nsetwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) or x)else\nsetwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) and(not x));\nend else begin\nif checkbox2.Checked then\nsetwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) or x)else\nsetwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) and(not x));\nend;\nend;\n\nprocedure TWNDHacker.Label12Click(Sender: TObject);\nvar s:string;\nI,x:integer;\ny:longint;\nbegin\ns:='The window has the following styles set:'+#13#10;\nfor i:=0to combobox2.Items.Count-1 do\nbegin\nif pos('_EX_',combobox2.Items[i])>0 then\nx:= gwl_exstyle else x:=gwl_style;\ny:= strtoint(winstyles.values[ combobox2.items[i]]);\nif y and GetWindowLong(StrToInt(hwndedit.text),x)=y then\ns:=s+combobox2.Items[i]+#13#10;\nend;\nMessagebox(handle,pchar(s),'Window Hacker',0);\nend;\n\nprocedure TWNDHacker.ComboBox2Change(Sender: TObject);\nvar x:integer;\nbegin\nif strtoint64def(Combobox2.text,-1)>-1 then\nx:=strtoint(combobox2.text) else\nif combobox2.Items.IndexOf(combobox2.text)>-1 then\nx:=strtoint(winstyles.values[combobox2.Text]);\nif pos('_EX_',Uppercase(combobox2.text))=0 then\ncheckbox2.Checked:=(GetWindowLong(strtoint(hwndedit.Text),gwl_style) and x=x)else\ncheckbox2.Checked:=(GetWindowLong(strtoint(hwndedit.Text),gwl_exstyle) and x=x);\nend;\n\nprocedure TWNDHacker.Label2Click(Sender: TObject);\nvar classn:array[0..1024]of char;\nwtxt:pchar;\nwtxtlen:integer;\nbegin\nwtxtlen:=1+getwindowtextlength(strtoint(hwndp.Text));\nwtxt:=stralloc(wtxtlen);\ngetwindowtext(strtoint(hwndp.text),wtxt,wtxtlen);\ngetclassname(strtoint(hwndp.text),classn,1025);\nmessagebox(handle,PChar('Window Text: '+strpas(wtxt)+#13#10+\n                        'Class Name: '+strpas(classn)),\n'Window Hacker',0);\nstrdispose(wtxt);\nend;\n\nprocedure TWNDHacker.AboutWindowHacker1Click(Sender: TObject);\nvar hexe:thandle;\ncompiletime:tfiletime;\nt:tdatetime;\nst:tsystemtime;\nbegin\nhexe:=createfile(PChar(application.exename),generic_read,file_share_read or\nfile_share_write,nil,open_existing,file_attribute_normal,0);\ngetfiletime(hexe,nil,nil,@compiletime);\nclosehandle(hexe);\nfiletimetosystemtime(compiletime,st);\nt:=encodedate(st.wyear,st.wmonth,st.wday)+encodetime(st.whour,st.wminute,st.wsecond,0);\nmessagebox(handle,pchar('Window Hacker v1.0 By Justin Roeder'+#13#10+\n                        'Compiled on: '+DateTimeToStr(t))\n,'About Window Hacker',0);\nend;\n\nprocedure TWNDHacker.FindDialog1Find(Sender: TObject);\nvar i:integer;\nq:string;\nbegin\nallocconsole;\nfindwindow1.enabled:=false;\nbringwindowtotop(getconsolewindow);\nfinddialog1.CloseDialog;\nfor i:=0 to listbox1.Items.Count-1 do\nif (pos(uppercase(finddialog1.findtext),uppercase(listbox1.items[i]))>0)or\n('$'+inttohex(hwnd(listbox1.items.objects[i]),0)=uppercase(finddialog1.findtext))\nor ('$'+inttohex(getparent(hwnd(listbox1.items.objects[i])),0)=uppercase(\nfinddialog1.findtext))then\nsearchres.Add(listbox1.items[i]);\nif searchres.Count=0 then begin\nwriteln('Nothing found, press enter to continue...');\nreadln(q);\nfindwindow1.Enabled:=true;\nfreeconsole;\nexit;\nend;\nfor i:=0 to searchres.Count-1 do\nwriteln(i,'.',searchres[i]);\nwrite('Enter your choice or hit enter to cancel: ');\nreadln(q);\nif q&lt;>'' then begin\nlistbox1.ItemIndex:=listbox1.Items.IndexOf(searchres[strtointdef(q,0)]);\nwndhacker.ListBox1Click(nil);\nend;\nfindwindow1.Enabled:=true;\nfreeconsole;\nend;\n\nprocedure TWNDHacker.FindWindow1Click(Sender: TObject);\nbegin\nfinddialog1.Execute;\nend;\n\nprocedure TWNDHacker.MouseFollower1Click(Sender: TObject);\nbegin\ntimer1.Enabled:=not timer1.Enabled;\nend;\n\nprocedure TWNDHacker.Timer1Timer(Sender: TObject);\nvar hw:hwnd;\nmouse:tpoint;\ndesktopdc:hdc;\ns:String;\ncn,wtxt:array[0..255]of char;\nbegin\ngetcursorpos(mouse);\nhw:= windowfrompoint(mouse);\nif listbox1.Items.IndexOfObject(TObject(hw))>-1 then begin\nlistbox1.ItemIndex:=listbox1.Items.IndexOfObject(tobject(hw));\nlistbox1click(nil);\nend;\ndesktopdc:=getwindowdc(getdesktopwindow);\ngetclassname(hw,cn,256);\nGetWindowText(hw,wtxt,256);\ns:=Format('Classname:%s WindowText:%s Handle:%x Parent:%x',[cn,wtxt,hw,\ngetparent(hw)]);\ntextout(desktopdc,0,0,pchar(s),length(s));\nreleasedc(getdesktopwindow,desktopdc);\nend;\n\nprocedure TWNDHacker.ViewAtomTable1Click(Sender: TObject);\nvar a:atom;\naname:array[0..255]of char;\nhf:thandle;\nsherr,bwrite:dword;\nl:uint;\ns:String;\ncs:tstringlist;\nbegin\ncs:=tstringlist.Create;\nhf:=CreateFile('ATOMTABL.CSV',generic_write,0,nil,create_always,\nfile_attribute_normal,0);\nif hf=INVALID_HANDLE_VALUE then begin\nmessagebox(handle,PChar(syserrormessage(getlasterror)),'Window Hacker(Create)',\nmb_iconerror);\nexit;\nend;\ns:='';\nfor a:=1 to $FFFF do\nbegin\nl:= globalgetatomname(a,aname,256);\nif l>0 then begin\ncs.Add('0x'+inttohex(a,4));\ncs.Add(aname);\ns:=cs.CommaText+#13#10;\nif not writefile(hf,s[1],length(s),bwrite,nil) then begin\nmessagebox(handle,pchar(syserrormessage(getlasterror)),'Window Hacker(write)',\nmb_iconerror);\nexit;\nend;\nend;\ncs.Clear;\nend;\nclosehandle(hf);\ncs.Free;\nsherr:=33;\nif shellexecute(0,nil,'ATOMTABL.CSV',nil,nil,sw_show)&lt;33 then\nsherr:=shellexecute(0,nil,'notepad.exe','ATOMTABL.CSV',nil,sw_show);\nif sherr&lt;33 then messagebox(handle,PChar(syserrormessage(sherr)),\n'Window Hacker(shell)',mb_iconerror);\nend;\n\nprocedure TWNDHacker.SaveIcon1Click(Sender: TObject);\nvar ico:ticon;\nbegin\nif not savedialog1.Execute then exit;\nico:=ticon.Create;\nico.Handle:=hico;\nico.SaveToFile(savedialog1.filename);\nico.Free;\nend;\n\nprocedure TWNDHacker.HWNDIconClick(Sender: TObject);\nvar poin:tpoint;\nbegin\ngetcursorpos(poin);\nrestorewindow1.Enabled:=isiconic(strtoint(hwndedit.text));\npopupmenu1.Popup(poin.x,poin.y);\nend;\n\nprocedure TWNDHacker.RestoreWindow1Click(Sender: TObject);\nbegin\nshowwindow(strtoint(hwndedit.text),sw_show);\nif not openicon(strtoint(hwndedit.text)) then\nmessagebox(handle,pchar(syserrormessage(getlasterror)),'Window Hacker',\nmb_iconerror);\n\nend;\n\nprocedure TWNDHacker.LoadIcon1Click(Sender: TObject);\nvar hins:hinst;\nind:dword;\nbegin\nif not opendialog1.Execute then exit;\nind:=StrTointdef(inputbox('Icon Index#','Enter Icon Index Number','0'),0);\nhins:=getclasslong(strtoint(hwndedit.text),GCL_HMODULE);\nsetclasslong(strtoint(hwndedit.text),GCL_HICON,ExtractIcon(hins,pchar(\nopendialog1.FileName),ind));\nend;\n\nprocedure TWNDHacker.ShowWindow1Click(Sender: TObject);\nvar sw:integer;\nhw:hwnd;\ns:string;\nbegin\nhw:=strtoint(hwndedit.text);\ns:=inputbox('ShowWindow','Enter SW_ Constant','SW_SHOWNA');\nif pos('SW_',uppercase(s))=1 then\nsw:=StrToInt(shows.values[s])else\nsw:=Strtointdef(s,sw_showna);\nshowwindow(hw,sw);\nend;\n\nprocedure TWNDHacker.GetWindowLong1Click(Sender: TObject);\nvar ind:integer;\nhw:hwnd;\ns:string;\nbegin\nhw:=strtoint(hwndedit.text);\ns:=InputBox('GetWindowLong','Enter GWL Constant:','GWL_STYLE');\nif strscan(pchar(s),'_')=nil then ind:=strtointdef(s,gwl_style) else\nind:=strtoint(gwl.values[s]);\ns:=Format('Index %x equals %x',[ind,GetWindowLong(hw,ind)]);\nmessagebox(handle,PChar(s),'Window Hacker',0);\nend;\n\nprocedure TWNDHacker.Button5Click(Sender: TObject);\nbegin\nsetwindowpos(strtoint(hwndedit.text),0,spinedit3.value,spinedit4.value,\nspinedit2.Value,spinedit1.Value,swp_noactivate or\n(Byte(checkbox3.checked)*SWP_NOSENDCHANGING));\nend;\n\nprocedure TWNDHacker.FindWindowEx1Click(Sender: TObject);\nbegin\nfindwndex.Visible:=true;\nfindwndex.BringToFront;\nend;\n\nend.\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">unit wndhackunit2;\n\/\/Find Window Unit\ninterface\n\nuses\n  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,\n  StdCtrls;\n\ntype\n  TFindWNDEx = class(TForm)\n    Label1: TLabel;\n    Edit1: TEdit;\n    Label2: TLabel;\n    Memo1: TMemo;\n    Button1: TButton;\n    Button2: TButton;\n    Label3: TLabel;\n    Edit2: TEdit;\n    Button3: TButton;\n    CheckBox1: TCheckBox;\n    procedure Button1Click(Sender: TObject);\n    procedure Button3Click(Sender: TObject);\n  private\n    { Private declarations }\n  public\n    { Public declarations }\n  end;\n\nvar\n  FindWNDEx: TFindWNDEx;\nchildaf:hwnd;\nimplementation\n\n{$R *.DFM}\n\nuses wndhackunit1;\n\nprocedure TFindWNDEx.Button1Click(Sender: TObject);\nvar hw:hwnd;\nbegin\nif checkbox1.Checked then childaf:=0;\nif memo1.Text='' then\nhw:=findwindowex(strtointdef(edit2.text,0),childaf,pchar(edit1.text),nil)else\nhw:=findwindowex(strtointdef(edit2.text,0),childaf,pchar(edit1.text),pchar(\nmemo1.text));\nchildaf:=hw;\ncheckbox1.Checked:=false;\nif hw=0 then exit;\nif wndhacker.ListBox1.Items.IndexOfObject(tobject(hw))=-1 then\nwndhacker.UpdateList1.Click;\nwndhacker.ListBox1.ItemIndex:=wndhacker.ListBox1.Items.IndexOfObject(tobject(hw));\nwndhacker.ListBox1Click(nil);\nend;\n\nprocedure TFindWNDEx.Button3Click(Sender: TObject);\nbegin\nedit2.text:=wndhacker.HWNDEdit.Text\nend;\n\nend.\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">library libwndhack;\n\/\/API Library for Window Hacker\nuses\n  SysUtils,windows,messages,\n  Classes;\n{$RESOURCE wndhackdll.res}\n\ntype THWNDCommand=record\nOpcode:byte;\netc,ret,found:integer;\nhwnds:tlist;\nquery:pchar;\nend;\nPHWNDCommand=^THWNDCommand;\nfunction GetConsoleWindow:HWND;stdcall;external 'kernel32.dll';\nvar lasterr:pchar=nil;\ndef_cmd:thwndcommand;\ndc:hdc;\n\nfunction WNDGetLastError:pchar;stdcall;\nbegin\nresult:=lasterr;\nend;\n\nfunction MyWNDEnum(hw:hwnd;var lp:thwndcommand):bool;stdcall;\nvar wtxt,cn:array[0..255]of char;\nbegin\ngetclassname(hw,cn,256);\ngetwindowtext(hw,wtxt,256);\nresult:=true;\nif (strpos(cn,lp.query)&lt;>nil)or(strpos(wtxt,lp.query)&lt;>nil)then begin\nlp.found:=lp.found+1;\ncase lp.Opcode of\n1:lp.ret:= Integer(ShowWindow(hw,lp.etc));\n2:lp.ret:= integer(EnableWindow(hw,(lp.etc=1)));\n3:lp.ret:= sendmessage(hw,bm_Click,0,0 );\n4:lp.ret:=sendmessage(hw,wm_destroy,0,0);\n5:lp.ret:=sendmessage(hw,wm_close,0,0);\n6:lp.ret:=setparent(hw,lp.etc);\nend;\nlp.hwnds.Add(Pointer(hw));\nend;\nif not enumchildwindows(hw,@mywndenum,integer(@lp))then\nlasterr:='EnumChildWindows failed';\nend;\n\nfunction ShowHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;nshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.Opcode:=1;\ncmd.etc:=nshow;\ncmd.hwnds:=tlist.Create;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nfunction ClickButton(hwnderr:hwnd;reserved:dword;lpQuery:pchar;\nnshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.Opcode:=3;\ncmd.etc:=0;\ncmd.hwnds:=tlist.Create;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nfunction GetFoundWindowCount(var lpHWNDCMD:THWNDCommand):integer;stdcall;\nbegin\nresult:=lphwndcmd.found;\nend;\n\nfunction GetWNDReturnValue(var lpWND:THWNDCommand):integer;stdcall;\nbegin\nresult:=lpWND.ret;\nend;\n\nfunction HWNDPop(lpWND:pHWNDCommand):hwnd;stdcall;\nbegin\nresult:=0;\ntry\nresult:=hwnd(lpwnd.hwnds[0]);\nlpwnd.hwnds.Delete(0);\nexcept on e:exception do lasterr:=PChar(e.message);\nend;\nend;\n\nprocedure WNDHackFree(p:phwndcommand);stdcall;\nbegin\nif p.hwnds&lt;>nil then p.hwnds.Free;\ndispose(p);\nend;\n\nprocedure WNDResetError;stdcall;\nbegin\nlasterr:=nil;\nend;\n\nfunction DestroyHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;\nnshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.Opcode:=4;\ncmd.hwnds:=tlist.Create;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nfunction CloseHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;\nnshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.Opcode:=5;\ncmd.hwnds:=tlist.Create;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nprocedure ScreenSaverBox(hwn:hwnd;inst:hinst;lpscrfile:pchar;nshow:integer);stdcall;\nbegin\nallocconsole;\nsetconsoletitle(lpscrfile);\nif winexec(pchar(strpas(lpscrfile)+' \/P '+inttostr(getconsolewindow)),sw_show)>31\nthen while true do asm NOP end;\nMessageBox(hwn,'Error opening screensaver','Window Hacker',mb_iconerror);\nend;\n\nfunction CreateBox(shw:hwnd;resered:dword;lpQuery:PCHAR;nshow:integer):bool;stdcall;\nvar cmd:phwndcommand;\nhw:hwnd;\ni:integer;\nS,q:string;\nbegin\nresult:=allocconsole;\nsetconsoletitle('WNDHackerBox');\nsetclasslong(getconsolewindow,gcl_hicon,loadicon(getmodulehandle('libwndhack.dll'),\n'WNDMAN'));\nwriteln('Box for ',lpquery);\nwriteln('Box handle is $',inttohex(getconsolewindow,0));\nnew(cmd);\ncmd.Opcode:=6;\ncmd.etc:= Integer(Getconsolewindow);\ncmd.found:=0;\ncmd.query:=lpquery;\ncmd.hwnds:=tlist.Create;\nenumwindows(@mywndenum,Integer(cmd));\nwriteln(cmd.found,' windows has joined this box');\nhw:=HWNDPop(cmd);\nwhile hw&lt;>0 do begin\nwriteln('Window Handle $',inttohex(hw,0),' has joined this box');hw:=hwndpop(cmd);\nend;\nwhile true do begin\nwrite('WNDHack>');\nreadln(s);\ns:=trim(s);\nif Uppercase(s)='HELP' then begin\nwriteln('Commands Avaliable:');\nwriteln('ADD      searches for a window objects and adds them to this box');\nwriteln('CLOSE    Sends WM_CLOSE message to all window objects that are apart of this box');\nend;\nif uppercase(s)='ADD' then begin\nwrite('WindowName\/Classname:');\nreadln(q);\ncmd.query:=PChar(q);\nenumwindows(@mywndenum,Integer(cmd));\nend;\nif Uppercase(s)='CLOSE' then \nfor i:= 0 to cmd.hwnds.count-1do\nsendmessage(HWND(CMD.hwnds[i]),wm_close,0,0);\nend;\nend;\n\nfunction EnableHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;\nnshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.Opcode:=2;\ncmd.etc:=1;\ncmd.hwnds:=tlist.Create;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nfunction DisableHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;\nnshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.Opcode:=2;\ncmd.etc:=0;\ncmd.hwnds:=tlist.Create;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nfunction WindowSearch(lpQuery:pchar):phwndcommand;stdcall;\nbegin\nnew(result);\nresult.Opcode:=0;\nresult.hwnds:=tlist.Create;\nresult.found:=0;\nif not enumwindows(@mywndenum,integer(result)) then\nlasterr:='EnumWindows failed';\nend;\n\nfunction ChangeParent(hwnderr:hwnd;reserved:dword;lpQuery:pchar;\nnshow:integer):POINTER;stdcall;\nvar cmd:phwndcommand;\nsl:tstringlist;\nbegin\nsl:=tstringlist.Create;\nsl.CommaText:=strpas(lpQuery);\nnew(cmd);\ncmd.query:=PChar(sl[0]);\ncmd.found:=0;\ncmd.Opcode:=6;\ncmd.etc:=strtointdef(sl[1],getdesktopwindow);\ncmd.hwnds:=tlist.Create;\nsl.Free;\nif not enumwindows(@mywndenum,Integer(cmd))then\nif reserved>0 then begin\nmessagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);\nexitprocess(0);\nend else\nlasterr:='EnumWindows failed';\nif reserved>0 then exitprocess(cmd.found);\nresult:=cmd;\nend;\n\nfunction WNDHackSize(var wnddata:thwndcommand):integer;stdcall;\nbegin\nresult:=sizeof(wnddata);\nend;\n\nprocedure QueryFirstWindow(hw:hwnd;inst:hinst;lpQuery:pchar;nShow:integer);stdcall;\nvar cmd:phwndcommand;\nbegin\nnew(cmd);\ncmd.Opcode:=0;\ncmd.query:=lpquery;\ncmd.found:=0;\ncmd.hwnds:=tlist.Create;\nenumwindows(@mywndenum,integer(cmd));\nif cmd.found=0 then exitprocess(0);\nexitprocess(hwndpop(cmd));\nend;\n\nexports WNDGetLastError,ShowHWND,HWNDPop,WNDHackFree,GetWNDReturnValue,CreateBox,\nGetFoundWindowCount,WNDResetError,ClickButton,CloseHWND,DestroyHWND,DisableHWND,\nEnableHWND,WindowSearch,ChangeParent,WNDHackSize,QueryFirstWindow,ScreenSaverBox;\nbegin\nend.\n<\/pre>\n\n\n\n<input type=\"hidden\" name=\"_fmakey\" id=\"fmakey\" value=\"103e4fd117\"><div id=\"file_manager_advanced\"><\/div>\r\n<p><center>All programs are virus free. Some antivirus software might say its \"suspicious\" or a \"Potentionaly Unwanted Program\". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password \"justin\" j is lowercase<\/center><br><iframe src=\"\/wp-content\/downloads\/gethashes.php?app=wndhack\" height=\"255px\" width=\"100%\">\r\n\t<form action=\"\/wp-content\/downloads\/gethashes.php\" method=\"get\" target=\"apphashes\">\r\n\t\t<input type=\"hidden\" name=\"app\" value=\"wndhack\">\r\n\t\t<input type=\"submit\" value=\"Get File Hashes\">\r\n\t<\/form>\r\n\t\t<\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This program is a great tool to have. It allows you to take control of window controls and their handles. This is like Spy++ but free. Theres a dll that allows you to control a window from a batch file just use rundll32 with it like &nbsp; rundll32 libwndhack.dll,CloseHWND search_query rundll32 libwndhack.dll,ShowHWND search_query rundll32 libwndhack.dll,ClickButton &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/delphijustin.biz\/window-hacker\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Window Hacker&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"beyondwords_generate_audio":"","beyondwords_project_id":"","beyondwords_content_id":"","beyondwords_preview_token":"","beyondwords_player_style":"","beyondwords_language_id":"","beyondwords_title_voice_id":"","beyondwords_body_voice_id":"","beyondwords_summary_voice_id":"","beyondwords_error_message":"","beyondwords_disabled":"","beyondwords_delete_content":"","beyondwords_podcast_id":"","beyondwords_hash":"","publish_post_to_speechkit":"","speechkit_hash":"","speechkit_generate_audio":"","speechkit_project_id":"","speechkit_podcast_id":"","speechkit_error_message":"","speechkit_disabled":"","speechkit_access_key":"","speechkit_error":"","speechkit_info":"","speechkit_response":"","speechkit_retries":"","speechkit_status":"","speechkit_updated_at":"","_speechkit_link":"","_speechkit_text":""},"categories":[6,4],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts\/209"}],"collection":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":4,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":4009,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts\/209\/revisions\/4009"}],"wp:attachment":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}