显示图像采集的设备接口

发布于 2024-10-04 22:14:23 字数 1089 浏览 0 评论 0原文

我正在使用 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
   }

如何等待用户输入?而且对话框也不出现,只有白色窗口?

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:


    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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人间不值得 2024-10-11 22:14:24

你考虑过EZTwain吗? 非常易于使用

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

它是免费的,并且 你的情况,我认为问题在于没有实现 // TO-DO。 TWAIN 使用消息循环进行通信,Windows 也是如此(例如绘制对话框)。

我假设你的循环实际上正在做更多的事情,但如果没有,你需要允许消息被泵送。

Have you considered EZTwain? It's free and very easy to use

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

In your case, I think the problem is with not implementing the // TO-DO. TWAIN uses the message loop to communicate, and so does Windows (to draw dialogs, for example).

I assume that your loop is actually doing something more, but if not, you need to allow messages to be pumped.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文