当前位置:首页
开发技术指南» 文章正文
    引言:

 ·vb编写active x问题    »显示摘要«
    摘要: 我现在要用vb创建一个active x控件,这个控件要被web页面调用,在web中的javascript 调用需要一个classid,这个是怎么回事,怎么产生这个id,请告诉我具体步骤,我刚刚开始接触vb.谢谢!! ......
 ·pb9+sqlserver2000。用 dw    »显示摘要«
    摘要: pb9+sqlserver2000。用 dw_1.retrieve( 参数1,参数2,参数3 )让数据窗口控件从数据库中提取数据,可是这个窗口对应当数据表(视图)有高达140万的记录,虽然符合条件的只有几十条(有时还没有),但每次retrieve都会很慢,如何优化使速度快些呢? ......


如何检测filemon程序是否运行

if   (CreateFile(PChar("\\\\.\\filemon"),      
                                        GENERIC_READ||GENERIC_WRITE,  
                                        FILE_SHARE_READ   ||   FILE_SHARE_WRITE,  
                                        NULL,  
                                        OPEN_EXISTING,  
                                        FILE_ATTRIBUTE_NORMAL,  
                                        0)   !=INVALID_HANDLE_VALUE)  
          MessageBox("检测到filemon");  
          else  
            MessageBox("没有filemon");  
  为什么着段代码检测不到filemon呢?

NO.1   作者: jiajun2001

谁告诉你用这这种方法检测的阿!?

NO.2   作者: junguo

msdn的例子,我改了一下,以一个写字本是否在运行为例!  
   
  #include   <windows.h>  
  #include   <tlhelp32.h>  
  #include   <stdio.h>  
  #include   <iostream.h>  
   
  //     Forward   declarations:  
  BOOL   GetProcessList(   );  
   
  void   printError(   TCHAR*   msg   );  
   
  void   main(   )  
  {  
      GetProcessList(   );  
  }  
   
  BOOL   GetProcessList(   )  
  {  
      HANDLE   hProcessSnap;  
      HANDLE   hProcess;  
      PROCESSENTRY32   pe32;  
       
      BOOL   bIsRuning   =   FALSE;  
   
      //   Take   a   snapshot   of   all   processes   in   the   system.  
      hProcessSnap   =   CreateToolhelp32Snapshot(   TH32CS_SNAPPROCESS,   0   );  
      if(   hProcessSnap   ==   INVALID_HANDLE_VALUE   )  
      {  
          printError(   "CreateToolhelp32Snapshot   (of   processes)"   );  
          return(   FALSE   );  
      }  
   
      //   Set   the   size   of   the   structure   before   using   it.  
      pe32.dwSize   =   sizeof(   PROCESSENTRY32   );  
   
      //   Retrieve   information   about   the   first   process,  
      //   and   exit   if   unsuccessful  
      if(   !Process32First(   hProcessSnap,   &pe32   )   )  
      {  
          printError(   "Process32First"   );     //   Show   cause   of   failure  
          CloseHandle(   hProcessSnap   );           //   Must   clean   up   the   snapshot   object!  
          return(   FALSE   );  
      }  
   
      //   Now   walk   the   snapshot   of   processes,   and  
      //   display   information   about   each   process   in   turn  
      do  
      {  
       
          //   Retrieve   the   priority   class.  
           
   
          if(   !   strcmp(   "notepad.exe",   pe32.szExeFile   ))  
  {  
  bIsRuning   =   true;  
  }  
           
   
           
   
      }   while(   Process32Next(   hProcessSnap,   &pe32   )   );  
   
      if   (   bIsRuning   )  
      cout<<"the   notepad   is   runing"   <<   endl;  
      else  
      cout<<"the   notepad   is   not   runing"   <<   endl;  
   
       
   
      CloseHandle(   hProcessSnap   );  
      while(1);  
      return(   TRUE   );  
  }  
   
   
   
   
  void   printError(   TCHAR*   msg   )  
  {  
      DWORD   eNum;  
      TCHAR   sysMsg[256];  
      TCHAR*   p;  
   
      eNum   =   GetLastError(   );  
      FormatMessage(   FORMAT_MESSAGE_FROM_SYSTEM   |   FORMAT_MESSAGE_IGNORE_INSERTS,  
                    NULL,   eNum,  
                    MAKELANGID(LANG_NEUTRAL,   SUBLANG_DEFAULT),   //   Default   language  
                    sysMsg,   256,   NULL   );  
   
      //   Trim   the   end   of   the   line   and   terminate   it   with   a   null  
      p   =   sysMsg;  
      while(   (   *p   >   31   )   ||   (   *p   ==   9   )   )  
          ++p;  
      do   {   *p--   =   0;   }   while(   (   p   >=   sysMsg   )   &&  
                                                      (   (   *p   ==   .   )   ||   (   *p   <   33   )   )   );  
   
      //   Display   the   message  
      printf(   "\n     WARNING:   %s   failed   with   error   %d   (%s)",   msg,   eNum,   sysMsg   );  
  }  
   
 

NO.3   作者: jiajun2001

同一楼上的方法!

NO.4   作者: oyljerry

枚举进程模块,CreateToolhelp32Snapshot   然后比较模块名称来判断  
  或简单的用FindWindow等来查找

NO.5   作者: lifengice0706

二楼已有正解!

NO.6   作者: jixingzhong

二楼  
   
   
   
   
  正解

NO.7   作者: jixingzhong

楼主有必要  
   
   
   
  看看   MSDN   !!

NO.8   作者: qqfqqf

在下列网址  
  http://www.yesky.com/184/1739684.shtml  
  其中if   (CreateFile(PChar("\\\\.\\filemon"),   一句变为  
  if   (CreateFile(PChar("\\\\.\\FILEVXD"),    
 


    摘要: 1--想从sql 查询中得到一个逻辑值,或者随便一个什么值,能用于后面的判断。 arraylist dingyu=new arraylist(); string sql="if exists(...) select a from table1 where ..." //能否用executereader()方法得到 select的查询结果,昨天有位朋友说用 // sq......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE