Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom menu and keyboard
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 item with key code?

I know you can help for this one Wink
Macro Macro1716
Copy      Help
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).
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.
Macro Macro1717
Copy      Help
__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"

LoadPictureFile does not support png. If need, can be used GflAx graphic library.
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.

Without temp file.
Macro Macro1718
Copy      Help
int hb=LoadPictureFile("$documents$\foto\kamane.JPG")
rep() if(OpenClipboard(_hwndqm)) break; else 0.01
SetClipboardData CF_BITMAP hb

act "Paint"
key Cv
LoadImageAnyFormat: Image manipulation
Same as LoadPictureFile but supports png. It uses gflax.

Forum Jump:

Users browsing this thread: 1 Guest(s)