AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Persistent hide window

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dll
Guest





PostPosted: Thu Aug 30, 2007 12:13 am    Post subject: Persistent hide window Reply with quote

I call a dll and I want to hide the messages that come from it. How can I do it?
My current solution is to have a side script that hide the window, but it always blinks, even with the SetWinDelay -1

I'm digging the onMessage without success.

Any suggestions?
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6086

PostPosted: Thu Aug 30, 2007 12:19 am    Post subject: Re: Persistent hide window Reply with quote

dll wrote:
I call a dll and I want to hide the messages that come from it. How can I do it?


Trialware ? Rolling Eyes
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Thu Aug 30, 2007 3:13 am    Post subject: Reply with quote

what dll?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
dll
Guest





PostPosted: Thu Aug 30, 2007 11:00 am    Post subject: Reply with quote

dll is EZTW32.DLL

It's for twain, the window that I want hide is the warnings that came frome twain, feeder without paper, etc.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6086

PostPosted: Thu Aug 30, 2007 11:04 am    Post subject: Re: Persistent hide window Reply with quote

dll wrote:
but it always blinks, even with the SetWinDelay -1


It is hard to avoid that blink .. Can you post a small portion of the code? Smile
Back to top
View user's profile Send private message
dll
Guest





PostPosted: Thu Aug 30, 2007 11:15 am    Post subject: Reply with quote

Is there a way to make the script to not stop until receives return from dll call? the problem is as the script wait for dll return, the dll post a window. Maybe making another thread inside script?

Code:

SetWinDelay -1

;I'm trying catching here without success
OnMessage(0x00000287,"fn")
fn(wParam, lParam)
{
msgbox dsdw
return
}


:it shows window here if it have no paper
DllCall("eztw32.dll\TWAIN_AcquireToFilename", UInt,0,"Str","wa.bmp")
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6086

PostPosted: Thu Aug 30, 2007 11:18 am    Post subject: Reply with quote

I do not think OnMessage() would work here as the dialog is not from AHK!
What will the title of the dialog be ? Will it change for different messages ?

Smile
Back to top
View user's profile Send private message
dll
Guest





PostPosted: Thu Aug 30, 2007 11:23 am    Post subject: Reply with quote

the title is allways the same.

The window is parent from the script, I see with winspector and it's in a subtree of the script.
Back to top
dll
Guest





PostPosted: Thu Aug 30, 2007 3:01 pm    Post subject: Reply with quote

Isn't a workaround this?

Tanks
Back to top
dll
Guest





PostPosted: Fri Aug 31, 2007 11:04 am    Post subject: Reply with quote

I'm trying to get if the scanner have the feeder loaded, is this dllcall right?

Code:
DllCall("eztw32.dll\TWAIN_GetCapCurrent",UInt,"CAP_FEEDERLOADED",UInt,"TWTY_BOOL","Cdecl Int*",aso)
msgbox %aso%


and here is the source function of eztw32.dll:
Code:
int EZTAPI TWAIN_GetCapCurrent(unsigned Cap, unsigned ItemType, void FAR *pVal)
{
   TW_CAPABILITY    cap;
   void far *      pv = NULL;
   BOOL         bSuccess = FALSE;

   assert(pVal != NULL);

   if (nState < TWAIN_SOURCE_OPEN) {
      TWAIN_ErrorBox("Attempt to get capability value below State 4.");
      return FALSE;
   }

   // Fill in capability structure
   cap.Cap = Cap;               // capability id
   cap.ConType = TWON_ONEVALUE;   // favorite type of container (should be ignored...)
   cap.hContainer = NULL;

   if (TWAIN_DS(DG_CONTROL, DAT_CAPABILITY, MSG_GETCURRENT, (TW_MEMREF)&cap) &&
       cap.hContainer &&
       (pv = GlobalLock(cap.hContainer))) {

      if (cap.ConType == TWON_ENUMERATION) {
         TW_ENUMERATION far *pcon = (TW_ENUMERATION far *)pv;
         TW_UINT32 index = pcon->CurrentIndex;
         if (index < pcon->NumItems && TypeMatch(pcon->ItemType, ItemType)) {
            LPSTR pitem = (LPSTR)pcon->ItemList + index*nTypeSize[ItemType];
            FMEMCPY(pVal, pitem, nTypeSize[ItemType]);
            bSuccess = TRUE;
         }
      } else if (cap.ConType == TWON_ONEVALUE) {
         TW_ONEVALUE far *pcon = (TW_ONEVALUE far *)pv;
         if (TypeMatch(pcon->ItemType, ItemType)) {
            FMEMCPY(pVal, &pcon->Item, nTypeSize[ItemType]);
            bSuccess = TRUE;
         }
      }
   }
   
   if (pv) GlobalUnlock(cap.hContainer);
   if (cap.hContainer) GlobalFree(cap.hContainer);

   return bSuccess;
}
Back to top
superbem



Joined: 30 Jul 2007
Posts: 20

PostPosted: Sat Sep 01, 2007 12:44 am    Post subject: Reply with quote

Please some more help would be appreciated.

Should I make other topic since it is not really to do with hide window?
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Tue Sep 04, 2007 5:32 pm    Post subject: Reply with quote

probably
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group