Search found 1602 matches

by tmplinshi
06 Nov 2013, 09:53
Forum: Ask for Help (v1)
Topic: Selecting items randoms from a list
Replies: 12
Views: 6210

Re: Selecting items randoms from a list

Just a shorter one:

Code: Select all

Total := 30 ; for example
nUp   := 6  ; for example select 6 items
t     := 1

While t <= nUP
{
	Random, Ran, 1, %Total%
	if Ran not in %numbers%
		numbers .= Ran ",", t ++
}

MsgBox %numbers%
by tmplinshi
05 Nov 2013, 02:23
Forum: Ask for Help (v1)
Topic: Load html and images using res:// is not a good idea
Replies: 4
Views: 2237

Re: Load html and images using res:// is not a good idea

Thank you all. :)

In this situation, I think the best choice is to use local files.
by tmplinshi
04 Nov 2013, 05:19
Forum: Ask for Help (v1)
Topic: Load html and images using res:// is not a good idea
Replies: 4
Views: 2237

Load html and images using res:// is not a good idea

I was trying to load html file from executable, use res:// protocol. Everything works fine, but then I noticed, that the images were extracted to temporary folder, such as "C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5\ATDI4LNP\E__res_html_res_html_exe[1...
by tmplinshi
24 Oct 2013, 01:06
Forum: Ask for Help (v1)
Topic: How to retrieve all RAS connections using api?
Replies: 3
Views: 2853

Re: How to retrieve all RAS connections using api?

Thanks for the replies. I've tested the WMI code, no results here.
by tmplinshi
23 Oct 2013, 06:33
Forum: Ask for Help (v1)
Topic: How to retrieve all RAS connections using api?
Replies: 3
Views: 2853

How to retrieve all RAS connections using api?

I want to know a specific RAS connection (vpn) is connected or not. The command line tools rasdial.exe and ipconfig.ex e can list all RAS connections, but I intended to retrieve the vpn status frequently (maybe per 5 seconds), so I think it is best to use Dllcall. (Another way is to query the IP add...
by tmplinshi
20 Oct 2013, 06:44
Forum: Ask for Help (v1)
Topic: Gui in function swap image proble
Replies: 3
Views: 2177

Re: Gui in function swap image proble

Add global TestSound to the function will work. (static TestSound won't work.)
by tmplinshi
19 Oct 2013, 19:56
Forum: Ask for Help (v1)
Topic: AHK GUI Border
Replies: 2
Views: 2296

Re: AHK GUI Border

How about:

Code: Select all

Gui, -Caption -Sysmenu +AlwaysOnTop +0x40000
Gui, Show, w300 h300
Return

GuiClose:
ExitApp
by tmplinshi
19 Oct 2013, 13:36
Forum: Ask for Help (v1)
Topic: how can i delete all files AND folders?
Replies: 16
Views: 11180

Re: how can i delete all files AND folders?

Code: Select all

FileRemoveDir, C:\My_Folder\, 1
This will delete C:\My_Folder\
by tmplinshi
19 Oct 2013, 13:19
Forum: Other Utilities & Resources
Topic: [DLL] - A dll to create L2TP VPN connection
Replies: 0
Views: 3241

[DLL] - A dll to create L2TP VPN connection

Found this dll from: http://www.autoitx.com/redirect.php?goto=findpost&ptid=6046&pid=40774&fromuid=7662608 Example : DllCall("Create_L2TP_VPN\createConn", "Astr", "vpn1", "Astr", "1.2.3.4") This will create a L2TP VPN connection, named vpn1 , and IP is 1.2.3.4 . Then you can connect to this vpn thro...
by tmplinshi
19 Oct 2013, 04:59
Forum: Ask for Help (v1)
Topic: Please help with gui button toggle
Replies: 7
Views: 6220

Re: Please help with gui button toggle

I always use two buttons: Start and Stop. Gui, Margin, 50, 50 Gui, Add, Button, w100 h40 vbtn_start gbtn_start, Start Gui, Add, Button, ys wp hp vbtn_stop gbtn_stop Disabled, Stop Gui, Show Return btn_stop: GuiControl, Disable, btn_stop IsStoped := True Return StopRun: GuiControl, Enable, btn_start ...
by tmplinshi
17 Oct 2013, 21:47
Forum: Ask for Help (v1)
Topic: How to load .cur from RCDATA?
Replies: 6
Views: 4066

Re: How to load .cur from RCDATA?

Well done! It works great! :D

Just needs to modify this two lines manually:

Code: Select all

NumPut(0, icon_info, 4) ; xHotspot
NumPut(0, icon_info, 8) ; yHotspot
by tmplinshi
17 Oct 2013, 18:18
Forum: Ask for Help (v1)
Topic: cannot run .bat file through AHK
Replies: 22
Views: 23733

Re: cannot run .bat file from AHK

Try this:

Code: Select all

if not A_IsAdmin
   Run, *RunAs C:\file.bat
else
    Run, C:\file.bat
Maybe the WorkingDir requires too:

Code: Select all

if not A_IsAdmin
   Run, *RunAs C:\file.bat, c:\
else
    Run, C:\file.bat, c:\
by tmplinshi
17 Oct 2013, 18:10
Forum: Ask for Help (v1)
Topic: [SOLVED] How to call SetClassLongPtr?
Replies: 7
Views: 3916

Re: [SOLVED] How to call SetClassLongPtr?

Thank you lexikos. I'm confused... A_PtrSize [AHK_L 42+]: Contains the size of a pointer, in bytes. This is either 4 (32-bit) or 8 (64-bit), depending on what type of executable (EXE) is running the script. Is this means when using AutoHotkey U64 .exe, the A_PtrSize will be 8, and using AutoHotkey A...
by tmplinshi
17 Oct 2013, 14:50
Forum: Ask for Help (v1)
Topic: How to load .cur from RCDATA?
Replies: 6
Views: 4066

Re: How to load .cur from RCDATA?

Thanks Zelio. Tested and works! Seems this is the only way to load from memory/resource. I've tried using a hIcon as hCursor, though the cursor will appear, but the cursor pointing to wrong position, see this example: https://gist.github.com/tmplinshi/7031199/raw/b9132ede1173340b211ab8b802c1bb47481f...
by tmplinshi
17 Oct 2013, 12:16
Forum: Ask for Help (v1)
Topic: How to load .cur from RCDATA?
Replies: 6
Views: 4066

Re: How to load .cur from RCDATA?

Yes, I want to compile it to exe. Thanks for help.
by tmplinshi
17 Oct 2013, 08:53
Forum: Scripts and Functions (v1)
Topic: htopmini v0.8.3
Replies: 79
Views: 32688

Re: htop mini ?!

Hi DataLife , this should be better: ; Allow moving the GUI by dragging any point in its client area. Gui, +hwndhMain OnMessage(0x201, "WM_LBUTTONDOWN") WM_LBUTTONDOWN(wParam, lParam, msg, hwnd) { global hMain If (hwnd = hMain) PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN } If use A_Gui, then click anywh...
by tmplinshi
17 Oct 2013, 08:28
Forum: Ask for Help (v1)
Topic: How to load .cur from RCDATA?
Replies: 6
Views: 4066

How to load .cur from RCDATA?

Gui, Add, Edit, w300 h100 ReadOnly hwndhEdit Gui, Show nSz := ResRead(Bin, "anicursor.ani") ; https://www.dropbox.com/s/riqzsgaxwn9jgmf/anicursor.ani ; nSz := ResRead(Bin, "arrow.cur") ; https://www.dropbox.com/s/w8ologp11oa3p7q/arrow.cur hCursor := DllCall( "CreateIconFromResourceEx", UInt,&Bin, U...
by tmplinshi
17 Oct 2013, 06:23
Forum: Ask for Help (v1)
Topic: SoundPlay Questions
Replies: 13
Views: 9013

Re: SoundPlay Questions

The flags of play command can be found on this page: http://msdn.microsoft.com/en-us/library/windows/desktop/dd743667(v=vs.85).aspx The mciSendString commands list: http://msdn.microsoft.com/en-us/library/windows/desktop/dd743572(v=vs.85).aspx hmm... I should provide links like Zelio did :P. Sorry P...
by tmplinshi
17 Oct 2013, 04:20
Forum: Ask for Help (v1)
Topic: [SOLVED] How to call SetClassLongPtr?
Replies: 7
Views: 3916

Re: How to call SetClassLongPtr?

Thank you both. Use dependency to check function whether exists is a good idea. Next time I will do this using DLL Export Viewer . So the solution is: if A_Is64bitOS DllCall("SetClassLongPtr", "Ptr", hEdit, "int", -12, "Ptr", hCursor_NO) else DllCall("SetClassLong", "Uint", hEdit, "int", -12, "int",...

Go to advanced search