Posts: 795
Threads: 136
Joined: Feb 2009
Hi Gintaras,
i struggle with this one:
say >> (double >) a trigger, which pulls a dynamic menu depending on a third key, in a limited time
So i press >>, wait for any key say between F1 and F12, and i pop a differnet menu upon F1, F2 etc.
My problems : i can't find proper interval for wait key macro wait 100 K (VK_F1), sometimes too late sometimes too quick.
And how to use sel...case item with key code?
I know you can help for this one
Posts: 12,087
Threads: 142
Joined: Dec 2002
Macro
Macro1716
int vk=wait(3 KF)
err ret ;;no keys in 3 s
if(vk<VK_F2 or vk>VK_F12) ret
sel vk
,case VK_F2
,out 2
,
,case VK_F3
,out 3
,
Or can be used __RegisterHotKey class. Works in exe (wait KF doesn't).
Posts: 795
Threads: 136
Joined: Feb 2009
OK, playing with the delay made the macro working.
Another problem : i have an image file called test.jpg or test.png.
I need to put the image (not the name or path, the real image) into clipboard and then paste it in another program.
Can't find a way to do it, i don't undersatnt the clipboard format and register stuff enough.
Then i will process the image after copying it according to it's extension, but i know how to achieve that.
Posts: 12,087
Threads: 142
Joined: Dec 2002
Macro
Macro1717
__GdiHandle hb=LoadPictureFile("$documents$\foto\kamane.JPG")
if(!hb) end "failed"
str sTempFile="$temp$\qm_bitmap.bmp"
if(!SaveBitmap(hb sTempFile)) end "failed"
act "Paint"
sTempFile.setsel(CF_BITMAP)
LoadPictureFile does not support png. If need, can be used GflAx graphic library.
Posts: 795
Threads: 136
Joined: Feb 2009
I expected something simplier than opening it to copy it in clipboard.
I'll try something with GflAx graphic library or irfan view, because i need many
processing routines, and if I open the file, i'm better off do maximum things
in the same time.
Ty
Posts: 12,087
Threads: 142
Joined: Dec 2002
Without temp file.
Macro
Macro1718
int hb=LoadPictureFile("$documents$\foto\kamane.JPG")
rep() if(OpenClipboard(_hwndqm)) break; else 0.01
EmptyClipboard
SetClipboardData CF_BITMAP hb
CloseClipboard
act "Paint"
key Cv
Posts: 12,087
Threads: 142
Joined: Dec 2002
LoadImageAnyFormat:
Image manipulation
Same as LoadPictureFile but supports png. It uses gflax.