Closed ptdev closed 9 years ago
Is your dll size: 20 480 bytes? You are using 64 bit Windows 10?
Add these error code checkers after each DllCall, e.g.
hVirtualDesktopAccessor := DllCall("LoadLibrary", "Str", "C:\Source\CandCPP\VirtualDesktopAccessor\x64\Release\VirtualDesktopAccessor.dll", "Ptr")
WinErrorcode := DllCall("GetLastError")
MsgBox, `Windows' errorcode is %WinErrorcode%
Should give 0 on each (no error).
Reference codes from here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
Hi, yes, my filesize is correct, I've downloaded your repository as is. And yes, I'm also running windows 10 64bit. However I am getting the following error after following your code checker instructions. Error 126 which according to the msdn site means "The specified module could not be found".
I'm not sure what that means, my filepaths are correct, and I've even tried to put the dll in my C:\ root to see if it was something to do with being on another drive, but I still get the same error.
I get 126 if I typo something in the file path. hmm. I've admin patched my AutoHotkey.exe using this instruction: http://autohotkey.com/board/topic/70449-enable-interaction-with-administrative-programs/ I wonder does it affect it?
You run the script given by Lexikos and it asks for AutoHotkey.exe it outputs AutoHotkey.exe you must save in C:\Program Files\ (other paths won't work).
Edit I remember using my DLL without that admin patch. It should work!
It has to be copy & paste "
it sometimes screws it by changing the character to some fancy Unicode char. Do you have editor that can show the characters are ANSI?
E.g.
Btw my ahk script has UTF8-8-BOM, but when you convert it to ANSI it shows the possible magic chars. You can then convert it back.
I've tried with the patched version and running it with the "run with ui access" that the patch creates but I get the same error. Also tried running as administrator with same results.
My script was UTF-8-without-BOM. I've since tried changing to ANSI and UTF-8-BOM but they all come up with the same error. Also tried creating an empty file in ANSI and pasting the script again. No go. Switching between encodings didn't appear to show any strange characters. I'm also using notepad++.
Anyway, I've shared my script on google drive in case you can maybe take a look or test it on your end:
https://drive.google.com/file/d/0BwoZAmP-h8zYb2JLQVkxQV9IZ0E/view?usp=sharing
Thanks again.
Hmm I wonder if it's a bug that works on my AutoHotkey.exe?
Try this:
hVirtualDesktopAccessor := DllCall("LoadLibrary", Str, "D:\Downloads\VirtualDesktopAccessor-master\x64\Release\VirtualDesktopAccessor.dll", "Ptr")
WinErrorcode := DllCall("GetLastError")
MsgBox, `Windows' errorcode is %WinErrorcode%
Notice that there is a bug in my script, that for some reason works on my computer anyway (AHK is weird). I had quoted "Str" even though it shouldn't be quoted but it works on my comp.
No, still the same error. I wonder if there's any kind of runtime or lib that needs to be installed? You probably use some dev tool like visual studio or something that installs something that maybe I don't have? I don't know..
Is your AutoHotkey running as 64 bit?
LoadLibrary is most basic call, it exists on all computers without Visual Studio.
Yes, it's running in 64bit. And yeah, I thought it wouldn't be that, windows 10 seems to already have most of this stuff installed and I never had any issues with missing runtimes or anything like that. I guess we'll just attribute this to yet another mysterious windows behavior? :) Thanks anyway for trying man, i wouldn't want to take any more of your time.
One more time, I tested this in Hyper-V virtualized pristine Windows 10, no visual studio in it or anything:
https://dl.dropboxusercontent.com/u/212719/AHKTest.zip
Drag test.ahk to AutoHotkeyU64.exe
It gives me error code 0, means no error.
My Windows 10 build is 10240, the stable. And virtualized Windows 10 is 10565, latest insider build.
facepalm I did install these https://www.microsoft.com/en-us/download/details.aspx?id=48145 both, x64 and x86 on the Hyper-V sometime ago.
Maybe it's those?
They are runtimes nothing really massive or developery thing. Stuff you get when you keep installing programs in the future.
I'm pretty sure this is it. just install vc_redist.x64.exe and vc_redist.x86.exe, it didn't even run hello world without those compiled from VS 2015 if I remember correctly.
Ah, yes! That fixed it! Thanks a lot for your help, that's some grade A support right here! :+1: I still wonder why MS decided to make people use both hands for switching desktops or use the mouse to click that little taskview icon as that totally defeats the purpose or virtual desktops in the first place.. but hey... this totally solves that issue. Thanks again!
Awesome!
Pro-AHK tip:
VWMess(wParam, lParam, msg, hwnd) {
desktopNumber := lParam + 1
Menu, Tray, Icon, Icons/icon%desktopNumber%.ico
// ...
Then find some good icons and put them "Icons/icon1.ico". The AHK icon gets old quickly.
Great! i've implemented that, much better, thanks :smiley:
Hey there, I saw a reply from you on superuser.com about this project that seems to do what I want but I seem to be having some issues. So, I've created a script that's pretty much just a copy paste from your readme, with updated path for the dll location of course. Now, when I press the key combination I get some messages like this on ahk:
Which appears to tell me that the shortcuts are working correctly. Unfortunately windows isn't switching to the desired desktop. This is the first time I've ever used ahk so maybe I'm doing somethng wrong or have some configuration issues. Can you give me some advice on how to fix this? Thanks.