vb.net - Send unsaved image or image from clipboard to to a program as a parameter -


question may not written.

i have image viewing program , able send image program, photoshop.

i can if image has saved source, can't figure out way send unsaved image program. adding image clipboard, , sending paste command application loads - works on condition paste command executed after program starts. mspaint, simple thread sleep fine. programs take unpredictable , long time open - gimp , photoshop - doesn't work unless set high enough sleep value.

so question - can send image clipboard program parameter, or there way somehow know if program has loaded? i've thought first saving image temp image , sending - rather program not attempt save temp directory when pressing save.

"is there way somehow know if program has loaded?"

i think closest generic answer you'll use process.waitforinputidle():

use waitforinputidle() force processing of application wait until message loop has returned idle state. when process user interface executing, message loop executes every time windows message sent process operating system. process returns message loop. process said in idle state when waiting messages inside of message loop. this state useful, example, when application needs wait starting process finish creating main window before application communicates window.

so do:

    dim p process = process.start("someapphere")     p.waitforinputidle() 

bear in mind, though, not applications load same way app might enter "idle" state before loaded...it depends on how designed.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -