Search found 1493 matches

by SKAN
10 Oct 2023, 22:00
Forum: Ask for Help (v2)
Topic: File size calculation (as in Windows)
Replies: 15
Views: 1060

Re: File size calculation (as in Windows)

DllCall("Shlwapi\StrFormatByteSize64A", "Int64",N, "Str",Format("{:16}",N), "Int",16, "AStr") Quite a weird way to use this function. It's better just like this: MsgBox DllCall("Shlwapi\StrFormatByteSize", "Int64", 1234567890, "Ptr", Buffer(16), "Int", 16, "Str")   Buffer(32) would be correct. MsgB...
by SKAN
09 Oct 2023, 10:40
Forum: Scripts and Functions (v2)
Topic: Ziggle() : A handy tool to lookup Win32 Constants
Replies: 97
Views: 20744

Re: Ziggle() : A handy tool to lookup Win32 Constants

one with a type difference for INVALID_SOCKET 18446744073709551615 4294967295 (in the lib it's max usize, so u64, guess it's u32 in whatever your database got it from, might want to hide it behind A_PtrSize check like other values?) Unsigned 32 bit value. Should be -1 instead. Why is invalid socket...
by SKAN
09 Oct 2023, 09:23
Forum: Scripts and Functions (v2)
Topic: Ziggle() : A handy tool to lookup Win32 Constants
Replies: 97
Views: 20744

Re: Ziggle() : A handy tool to lookup Win32 Constants

Noticed things like `\n IMAGE_ARCHIVE_END \n IMAGE_ARCHIVE_END which might indicate some parsing issue with AHK due to the backtick?   I will look into that.   Have included 1105 entries from your list ( 1809 entries ) Out of curiosity, what about the other ~700 entries?   They have been included i...
by SKAN
09 Oct 2023, 00:34
Forum: Scripts and Functions (v2)
Topic: Ziggle() : A handy tool to lookup Win32 Constants
Replies: 97
Views: 20744

Re: Ziggle() : A handy tool to lookup Win32 Constants

0.5k constants with different values... Constant crate ziggle Comment DEPENDENT_DISK_FLAG_PARENT 256 32 0x00000100=256 per msdocs https://learn.microsoft.com/en-us/windows/win32/api/virtdisk/ne-virtdisk-dependent_disk_flag ...   Oh! My parser had a mistake. Thanks for the valuable feedback! :thumbu...
by SKAN
23 Sep 2023, 01:07
Forum: Scripts and Functions (v1)
Topic: SetClipboardHTML() for V1.1 & V2
Replies: 29
Views: 7586

Re: SetClipboardHTML() for V1.1 & V2

Thanks a lot SKAN ! I did have a problem though. Each time I paste something, it would be prefixed with "html>". So I added a + 5 on line 20 : Html := StrReplace(Html, "StartHTML:000000000", Format("StartHTML:{:09}", InStr(Html, "<html>")+5) , Fix*) Seems to have fixed my problem. (I'm using Win10 ...
by SKAN
20 Sep 2023, 06:55
Forum: Scripts and Functions (v1)
Topic: CreateDDB() : Create alpha hBitmap with series of AARRGGBB hex values.
Replies: 9
Views: 2853

CreateDDB() for V2.0

Changes: LTrim not required for PixelData owing to intro of Smart LTrim NumPut's parameters were reordered to allow a sequence of values.. and that allows input of PixelData with string manipulation.     The function : ( along with a demo )   CreateDDB(PixelData, W, H) ; By SKAN for ah2 on D39B/D69K...
by SKAN
19 Sep 2023, 10:22
Forum: Scripts and Functions (v1)
Topic: RunAsTask() - Auto-elevates script without UAC prompt
Replies: 121
Views: 74987

Re: RunAsTask() - Auto-elevates script without UAC prompt

Isn't it the default to have to run shutdown.exe (plus, I assume, other shutdown commands like a shutdown.ahk) from an elevated command prompt? I don' t think so. I normally call ComObject("Shell.Application").ShutdownWindows() in my (non-elevated) always-running-script (Win7,Win10,Win11)... and at...
by SKAN
18 Sep 2023, 21:17
Forum: Scripts and Functions (v1)
Topic: RunAsTask() - Auto-elevates script without UAC prompt
Replies: 121
Views: 74987

Re: RunAsTask() - Auto-elevates script without UAC prompt

Philister wrote:
18 Sep 2023, 13:54
SKAN wrote:
18 Sep 2023, 11:28
What happens when you click launch Shutdown.ahk without admin privileges :?
Literally nothing. The script runs but the shutdown command has no effect.
 
Try to fix that problem instead of working it around.
by SKAN
18 Sep 2023, 11:28
Forum: Scripts and Functions (v1)
Topic: RunAsTask() - Auto-elevates script without UAC prompt
Replies: 121
Views: 74987

Re: RunAsTask() - Auto-elevates script without UAC prompt

if I create a script Shutdown.ahk with the only command Shutdown, 1 and execute it from Total Commander (running non-privileged), nothing happens. When I right-click on the script and run it as administrator, I get a UAC prompt and the PC shuts down on confirmation.   What happens when you click la...
by SKAN
18 Sep 2023, 10:52
Forum: Scripts and Functions (v2)
Topic: Ziggle() : A handy tool to lookup Win32 Constants
Replies: 97
Views: 20744

Re: Ziggle() : A handy tool to lookup Win32 Constants

removed duplicates (though haven't checked which of the dupes is correct, just left the first one That's almost correct, the second one is being picked from winrt subfolder except IID_IResourceManager which has 3 entries?! https://www.magnumdb.com/search?q=IID_IResourceManager Unable to decide abou...
by SKAN
18 Sep 2023, 08:32
Forum: Scripts and Functions (v1)
Topic: RunAsTask() - Auto-elevates script without UAC prompt
Replies: 121
Views: 74987

Re: RunAsTask() - Auto-elevates script without UAC prompt

Philister wrote:
18 Sep 2023, 01:45
Currently, I can't get Autohotkey's Shutdown command to work unless the command is issued with admin privileges.
I don't understand! why?
This version (for AHK 1.1) of RunAsTask() doesn't process command line parameters.
 

Code: Select all

#NoTrayIcon
RunAsTask() ; self elevate 
Shutdown 5
by SKAN
15 Sep 2023, 22:38
Forum: Ask for Help (v1)
Topic: [SOLVED] Issues with GDI+ GdipEffectCreate
Replies: 12
Views: 2783

Re: [SOLVED] Issues with GDI+ GdipEffectCreate

lexikos wrote:
15 Sep 2023, 17:56
Yes, assuming the function takes a GUID by value. In general, this is how you pass a struct by value in current versions. v2.1 allows defining the GUID struct and specifying that as the parameter type instead (but it is still in alpha).
 
Thanks @lexikos :thumbup:
by SKAN
15 Sep 2023, 11:19
Forum: Ask for Help (v1)
Topic: [SOLVED] Issues with GDI+ GdipEffectCreate
Replies: 12
Views: 2783

Re: [SOLVED] Issues with GDI+ GdipEffectCreate

iseahound wrote:
15 Sep 2023, 08:14
Don't use this API. GdipEffectCreate has been abandoned by Microsoft and has bugs that will never be fixed.
Oh! Any links to understand this more?
by SKAN
15 Sep 2023, 05:01
Forum: Ask for Help (v1)
Topic: [SOLVED] Issues with GDI+ GdipEffectCreate
Replies: 12
Views: 2783

Re: Issues with GDI+ GdipEffectCreate

Well, I have solved the issue! :superhappy: :dance: :bravo: if (A_PtrSize == 4) ; x86: Pass GUID as two 64-bit parameters retVal := DllCall("gdiplus\GdipCreateEffect", Int64, NumGet(CLSID, 0, "Int64"), Int64, NumGet(CLSID, 8, "Int64"), PtrP, hEffect) else ; x64: Pass GUID as a pointer(!?) retVal :=...
by SKAN
14 Sep 2023, 05:35
Forum: Scripts and Functions (v2)
Topic: Eject() : For Removable storage devices
Replies: 3
Views: 1400

Re: Eject() : For Removable storage devices

Joeyy wrote:
14 Sep 2023, 05:30
Where am I wrong?
You are trying only the example without the function Eject().
Paste Eject() function into the example and run it again.
by SKAN
13 Sep 2023, 06:57
Forum: Scripts and Functions (v2)
Topic: Ziggle() : A handy tool to lookup Win32 Constants
Replies: 97
Views: 20744

Ziggle() : Data file updated

GdiPlus constants were (almost) hand-compiled from header files and there were a few errors.
Attaching here a script of GdiPlus constants as well as data file that has been included in Ziggle3.zip
by SKAN
08 Sep 2023, 07:27
Forum: Scripts and Functions (v2)
Topic: Ziggle() : A handy tool to lookup Win32 Constants
Replies: 97
Views: 20744

Re: Ziggle() : A handy tool to lookup Win32 Constants

eugenesv wrote:
08 Sep 2023, 06:05
Is it possible to somehow use this data directly in scripts like
Include 173416 Constants? :shock:
Not suitable for a interpreted language, IMO.
by SKAN
29 Aug 2023, 03:30
Forum: Ask for Help (v2)
Topic: The problem about showing watermark on desktop
Replies: 16
Views: 966

Re: The problem about showing watermark on desktop

Code: Select all

Gui, MyGui:+OwnerhOwner 

Perhaps there's a very simple mistake? I just don't know why. :?
Simple:

Code: Select all

Gui, MyGui:+Owner%hOwner% 
by SKAN
28 Aug 2023, 22:37
Forum: Off-topic Discussion
Topic: Windows file size calculation? Topic is solved
Replies: 8
Views: 8072

Re: Windows file size calculation? Topic is solved

andymbody wrote:
28 Aug 2023, 19:05
Was that referenced post yours @SKAN or @lexikos ?
FormatBytes1() was by me and FormatBytes2() was by @lexikos both posted in the same topic.
by SKAN
28 Aug 2023, 09:49
Forum: Ask for Help (v2)
Topic: SoundPlay takes 400ms to return despite specifying no wait?
Replies: 11
Views: 982

Re: SoundPlay takes 400ms to return despite specifying no wait?

Result from @just me's code: 547.0 - 36.333333333333336

Go to advanced search