简体   繁体   English

显示图像采集的设备界面

[英]Showing Image Acquisition's Device Interface

I'm using TWAIN 2.1, to connect to Scanner, let user change any option, and wait for input, the problem whenever the scanner interface shows, the cursor still give indication about certain loop, or working,,, this is the following code: 我正在使用TWAIN 2.1,连接到扫描仪,让用户更改任何选项,然后等待输入,只要扫描仪界面显示,该问题便会出现,光标仍会指示某些循环或正在工作,这是以下代码:


    HWND g_hwnd = CreateWindow ("STATIC",
                          "",
                          WS_POPUPWINDOW,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          HWND_DESKTOP,
                          0,
                          g_hinstDLL,
                          0);

   TW_USERINTERFACE ui;
   ui.ShowUI = TRUE;
   ui.ModalUI = TRUE;
   ui.hParent = g_hwnd;
   // g_pDSM_Entry -> 
   int code = (*g_pDSM_Entry) (&g_AppID,
                           &g_SrcID,
                           DG_CONTROL,
                           DAT_USERINTERFACE,
                           MSG_ENABLEDSUIONLY,
                           (TW_MEMREF) &ui);

   if(TWRC_SUCCESS != code) {
       return;
   }
   MSG msg;
   while(GetMessage ((LPMSG) &msg, g_hwnd, 0, 0)){
       // TO-DO
   }

How can wait for user input?also the dialog doesn't appear, just white window? 如何等待用户输入?对话框也没有出现,只有白色的窗口?

Have you considered EZTwain? 您考虑过EZTwain吗? It's free and very easy to use 它是免费的,非常易于使用

http://www.dosadi.com/eztwain1.htm http://www.dosadi.com/eztwain1.htm

In your case, I think the problem is with not implementing the // TO-DO . 就您而言,我认为问题在于未实现// TO-DO TWAIN uses the message loop to communicate, and so does Windows (to draw dialogs, for example). TWAIN使用消息循环进行通信,Windows也进行通信(例如,绘制对话框)。

I assume that your loop is actually doing something more, but if not, you need to allow messages to be pumped. 我假设您的循环实际上在做更多的事情,但是如果没有,则需要允许发送消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM