Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom menu and keyboard
#1
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 Wink
#2
Macro Macro1716
Code:
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).
#3
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.
#4
Macro Macro1717
Code:
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"
sTempFile.setsel(CF_BITMAP)

LoadPictureFile does not support png. If need, can be used GflAx graphic library.
#5
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
#6
Without temp file.
Macro Macro1718
Code:
Copy      Help
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
#7
LoadImageAnyFormat: Image manipulation
Same as LoadPictureFile but supports png. It uses gflax.


Forum Jump:


Users browsing this thread: 1 Guest(s)