Search Results

Search found 746 results on 30 pages for 'winapi'.

Page 11/30 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How to GetGuiResources for all system processes?

    - by Krzysztof
    Hello, I need to measure all used GDI objects in a Windows xp system. I found a GetGuiResources(__in HANDLE hProcess, __in DWORD uiFlags) method (with the GR_GDIOBJECTS flag). I call it for the process which I get from the method GetCurrentProcess() defined in WinBase.h. I don't know how to call it for other system processes, which I get by System::Diagnostics::Process::GetProcesses(), because that function returns an array of Process pointers, and GetGuiResources takes a HANDLE. Does anybody know a solution for that? How can I transform Process pointer to a Handle or get HANDLEs for all running system processes? thanks for help in advance!

    Read the article

  • Does GetSystemInfo (on Windows) always return the number of logical processors?

    - by mhughes
    Reading up on this, and specifically reading the Microsoft docs, it looks like it should be returning the number of PHYSICAL processors, and that you should use GetLogicalProcessorInformation to figure out how many LOGICAL processors you have. Here's the doc I found on the SYSTEM_INFO structure: http://msdn.microsoft.com/en-us/library/ms724958(v=VS.85).aspx And here's the doc on GetLogicalProcessorInformation: (spaces added to get through spam filter) http:// msdn.microsoft.com/ en-us/ library/ ms683194.aspx Reading up on it further though, in most of the discussions I've found on this topic, developers say to that GetSystemInfo (and the SYSTEM_INFO structure) report the number of LOGICAL processors. When I search again, I find that MS did release some info on this (and a hot fix), here (spaces added to get through spam filter): http:// support. microsoft.com/ kb/936235 Reading that, it sounds like on Xp, pre-service Pack 3, GetSystemInfo reports the number of LOGICAL processors in the SYSTEM_INFO structure. It also reads to me that on Windows Vista and Windows 7, GetSystemInfo should be reporting the number of PHYSICAL processors (different to Windows XP pre-service Pack 3). Does anyone know what it actually does? Does GetSystemInfo really report the number of physical processors (on the same computer) differently, depending on which OS it's running on?

    Read the article

  • Why isn't WH_MOUSE hook global anymore?

    - by Valentin Galea
    I have this global mouse hook setup in a DLL that watches for mouse gestures. Everything works perfectly but with a hook set for WH_MOUSE_LL which is a low-level hook and one that doesn't need to be in an external injectable DLL. Once I switch - to the more suitable one would say - WH_MOUSE mouse hook, everything falls apart. Once I click outside my main application (the one that installs the hook), the hook gets corrupted - ::UnhookWindowsHookEx will fail. I only found this guy saying at experts exchange: "No way, at least under Windows XP + SVP2 WH_MOUSE won't go global, you must use WH_MOUSE_LL instead." I setup the hooks correctly: in a DLL using a shared data section, posting and not sending messages from the hook proceduce. Why has this changed? And why is not documented? Anyone encountered this? Thanks! BTW: I've reverse engineered a bit the popular StrokeIt application and it uses a combination of WH_GETMESSAGE and WH_MOUSE hooks and still works on XP/Vista...

    Read the article

  • How to catch Keyboard and mouse events?

    - by Alexey Malistov
    I want to create an application. This application has to do something when a user presses special keys on keyboard or/and uses scroll wheel. This application is a service. It has no windows. I want to catch any keyboard or mouse events which were designed with other applications. For example, you are watching TV by 3rd party application. If you press Ctrl + Shift and use scroll wheel my application changes the volume. I use Windows 7 x64 and Visual Studio 2008.

    Read the article

  • Windows API GUI programming

    - by genesys
    Hi! I'm working on a Project with outdated, very old looking GUI (the used GUI framework is more than 10 years old) Since the used programming language is Eiffel, there are almost no good libraries for GUI development. Although Wrappers for C libraries exist, it's not that easy to wrap something like Qt with them. The current GUI framework uses the Windows API to create windows, widgets and so on. But as stated - it's very old. Now i would like to learn more about how to use the Windows API directly to create state of the art GUI's Can someone recommend any reading material? Thanks!

    Read the article

  • How to get smartcard reader name in Windows 7 using C#?

    - by AndrejaKo
    Hi! I'm trying to make a C# program which will use a C .dll (unfortunately, the .dll doesn't have good documentation) to access a smart card. One of the functions of the .dll uses name of the reader as argument. My problem is that I don't know how to get the name. After looking for answers I found something similar to what I need in an example here: http://msdn.microsoft.com/en-us/library/aa379803%28VS.85%29.aspx I'm looking for a way to get szReader value as described in the aforementioned example using C#. Can anyone help me or at least point me in the right direction?

    Read the article

  • ImpersonateLoggedOnUser and starting a new process that uses ocx fails.

    - by markus
    I write a c++ windows application (A), that uses LogonUser, LoadUserProfile and ImpersonateLoggedOnUser to gain the rights of another user (Y). Meaning the A starts using the user that is logged on on the workstation (X). If the user wants to elevate his rights he can just press a button and logon as another user without having to log himself out of windows and back in. The situation now is (according to the return values of the functions): LogonUser works, LoadUserProfile works and ImpersonateLoggedOnUser works as well. After the impersonation I start another process. This process is an application (B) that needs an OCX control. This fails and the application tells me that the .oxc file is not properly installed. The thing is, if I start B directly as the user that is logged on to the machine (X), it works. If I start B directly as the user (Y) to which I want to elevate my rights using A, it works. If I am logged in as (X) and choose "run as" (Y) in the explorer, it works! Do you know which steps I need to do to do the same as the "run as" dialog from windows?

    Read the article

  • Windows Task Scheduler: IAction.QueryInterface() returns an error I cannot find a definition for

    - by Sascha
    Hello I am attempting to schedule a task (to open an .exe at a specific time) using C++ win32. But at one specific point I am getting an error, I have searched & searched to try & find the definition of this error but I cannot find it? Do you know what this error means: Hexadecimal: 80004003 Decimal: 2147500035 I wont post the whole function because its rather long (unless you may need it to determine the error context?). The code I am using (that causes the error) is the following: // QI for the executable task pointer. hr = action -> QueryInterface( IID_IExecAction, (void**) execAction ); action -> Release(); if( FAILED(hr) ) { printf("QueryInterface call failed for IExecAction: %x %X %u \n", hr, hr, hr ); rootFolder -> Release(); task -> Release(); CoUninitialize(); return false; } The output is: QueryInterface call failed for IExecAction: 80004003 80004003 2147500035

    Read the article

  • Listing serial (COM) ports on Windows?

    - by Eli Bendersky
    Hello, I'm looking for a robust way to list the available serial (COM) ports on a Windows machine. There's this post about using WMI, but I would like something less .NET specific - I want to get the list of ports in a Python or a C++ program, without .NET. I currently know of two other approaches: Reading the information in the HARDWARE\\DEVICEMAP\\SERIALCOMM registry key. This looks like a great option, but is it robust? I can't find a guarantee online or in MSDN that this registry cell indeed always holds the full list of available ports. Tryint to call CreateFile on COMN with N a number from 1 to something. This isn't good enough, because some COM ports aren't named COMN. For example, some virtual COM ports created are named CSNA0, CSNB0, and so on, so I wouldn't rely on this method. Any other methods/ideas/experience to share? Edit: by the way, here's a simple Python implementation of reading the port names from registry: import _winreg as winreg import itertools def enumerate_serial_ports(): """ Uses the Win32 registry to return a iterator of serial (COM) ports existing on this computer. """ path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM' try: key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path) except WindowsError: raise IterationError for i in itertools.count(): try: val = winreg.EnumValue(key, i) yield (str(val[1]), str(val[0])) except EnvironmentError: break

    Read the article

  • Windows API Programming

    - by Chris
    I found this site, http://www.apitalk.com/document.php?id=1184207999_1 and I'm not sure if this site is using ATL, STL, MFC, or just calling API functions directly. I have done console programming with C++ and graphics programmign with C++ in Borland, but I've have never done Win32 C++ programming and I'm curious if anyone knows of a good site to start with? Does anyone know of any good sites to recommend about getting up and going fast with Win32 API C++?

    Read the article

  • SHGetFolderPath returns path with question marks in it

    - by Colen
    Hi, Our application calls ShGetFolderPath when it runs, to get the My Documents folder. This normally works great. However, for three users - ???????, Jörg and Jörgen (see if you can spot the pattern!) - the call returns some very strange results. For example, for ???????, the call returns: c:\Users\???????\Documents I assume there's some sort of character encoding shenanigan going on here, possibly related to Unicode, but I don't have any experience with that sort of thing. How can I get a useful path to the folder (and other related folders) out of windows, without grovelling through registry keys for the information? In an email to me, ??????? ("Dmitry"), told me his "my documents" folder was actually located here: C:\Users\43D6~1\Documents So I know there's a way to get a "normal" version of the path out of Windows, I just don't know what it is. Background: Our application is not unicode-aware, and uses standard "char *" strings. How can we get the "normal" path? I'm not opposed to calling the "unicode" version of the function, then converting it to "normal" text, if that's possible. Converting the application entirely to use unicode is not an option here (we don't have the time). Thanks.

    Read the article

  • Win32 API Programming - Is it worth ?

    - by nXqd
    Now I code win32 api windows explorer . But it seems quite hard to me.I've a month to do it. But through the time I code, I wonder is it worth that I code win32 api ? . When we can create GUI easily with MFC or even easier with C#. What should I do ? 1- Keep coding with win32 api to deeply understand about them. 2- Just learn and code some programs to understand how they work. Can you determine how many time does it take in each choice ( or how many projects ). Thx for reading, as a 2nd student of IT University I really want your advice in this. My purpose is becoming a good and effective programmer :) PS: recommended books are really appreciated.

    Read the article

  • Change Keyboard Layout for Other Process

    - by SLaks
    I'm writing a program in C# that runs in the background and allows users to use a htokey to switch keyboard layouts in the active window. (Windows only supports CTRL+SHIFT & ALT+SHIFT) I'm using RegisterHotKey to catch the hotkey, & it's working fine. The problem is that I can't find any API to change the keyboard layout for the focused window. ActivateKeyboardLayout and LoadKeyboardLayout can only change the keyboard layout for the calling thread. Does anyone know how to change the keyboard layout for a different thread (the way the Language Bar does)?

    Read the article

  • check item in popupmenu

    - by alex-gu
    i call popumemu(list of checkboxes in another program) using code like: PostMessage(Wnd,WM_RBUTTONDOWN,0,0x0); PostMessage(Wnd,WM_RBUTTONUP,0,0x0); and i can get the HWND of popupmenu window how to check(uncheck) item at certain item? without sending code SendMessage( TMP,WM_KEYDOWN, VK_DOWN, 0); SendMessage( TMP,WM_KEYUP, VK_DOWN, 0); SendMessage( TMP,WM_KEYDOWN, VK_RETURN, 0); SendMessage( TMP,WM_KEYUP, VK_RETURN, 0); or there is another way to call popupmenu and check its item?

    Read the article

  • Automating an application

    - by dacman
    I've always wondered the best way to automate use of a GUI in windows. When I was about 15, I wrote a little application that used some simple windows api functions to automatically click on certain locations on the screen based on a script. This could be used to automate GUI apps, but surely it's not the best way. So, my question is: What's the best way to automate use of a GUI in windows? Are there certain windows API functions that would be beneficial? If the program were to crash, how could you detect that? Thanks!

    Read the article

  • How to locate a file in windows explorer

    - by Yigang Wu
    I have a application to list all music files in user machine, a "Explorer" button is using to quickly open Windows Explorer and highlight the file in Windows Explorer. I tried ShellExecute, but it doesn't work, the API will launch associate application. Any Windows API can do that? Thanks in advance.

    Read the article

  • Windows API Programming Startup

    - by Guru
    Hello, I want to learn windows API and PInvoke methods just like MesseageBeep in User32.dll. Can you refer a book or a website where I can learn all of those in step by step way. An ebook will also be appreciated. Thanks in advance, Guru.

    Read the article

  • FreeLibrary vs implicit unloading DLL

    - by Adil
    I have implemented a DLL including DllMain() entry function:- BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { case DLL_PROCESS_ATTACH: ... case DLL_THREAD_ATTACH: ... case DLL_THREAD_DETACH: ... case DLL_PROCESS_DETACH: ... } Unfortunately i made a mistake in DLL_PROCESS_DETACH case and accessing illegal memorey (access violation). I made a sample program which loads the library using LoadLibrary() function, uses the library function and finally call FreeLibrary() and return. When i executed this program, i didnt get any error message. But if i remove FreeLibrary(), in that case the DLL_PROCESS_DETACH case is executed implicitly and this time it gives error dialog box mentioning that there is access violation. Why calling FreeLibrary() suppress this error? OR internally it handles this exception? What is suggested way.

    Read the article

  • C++ library for dealing with multiple HTTP connections

    - by JWood
    Hi, I'm looking for a library to deal with multiple simultaneous HTTP connections (pref. on a single thread) to use in C++ in Windows so it can be Win32 API based. So far, I have tried cURL (multi interface) which seems to be the most appropriate that I have found but my problem is that I may have a queue of 200 requests but I need to only run 4 of them at a time. This becomes problematic when one request may take 2 seconds and another may take 2 mins as you have to wait on all handles and receive the result of all requests in one block. If anyone knows a way round this it would be very useful. I have also tried rolling my own using WinHTTP but I need to throttle the requests so they would ideally need to be on a single thread and use callbacks for data which WinHTTP does not do. The best thing I've found which would solve all my problems is ASIHTTPRequest but unfortunately it's Mac OSX only. Thanks, J

    Read the article

  • GetDiskFreeSpaceEx reports wrong number of free bytes

    - by rboorgapally
    __int64 i64FreeBytes unsigned __int64 lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes; // variables used to obtain // the free space on the drive GetDiskFreeSpaceEx (Manager.capDir, (PULARGE_INTEGER)&lpFreeBytesAvailableToCaller, (PULARGE_INTEGER)&lpTotalNumberOfBytes, (PULARGE_INTEGER)&lpTotalNumberOfFreeBytes); i64FreeBytes = lpTotalNumberOfFreeBytes; _tprintf(_T ("Number of bytes free on the drive:%I64u \n"), lpTotalNumberOfFreeBytes); I am working on a data management routine which is a Windows CE command line application. The above code shows how I get the number of free bytes on a particular drive which contains the folder Manager.capdir (it is the variable containing the full path name of the directory). My question is, the number of free bytes reported by the above code (the _tprintf statement) doesn't match with the number of free bytes of the drive (which i check by doing a right click on the drive). I wish to know if the reason for this difference?

    Read the article

  • LockWorkStation - Compilation error - identifier not found

    - by Microkernel
    Hi All, I am writing an application in which I got to lock the computer screen (OS is Windows). My Application is in C++. For this purpose I used the LockWorkStation() API defined on msdn, http://msdn.microsoft.com/en-us/library/aa376875%28VS.85%29.aspx I have included windows.h as told but still I am getting compilation error: .\source.cpp(5) : error C3861: 'LockWorkStation': identifier not found here is a sample code thats giving error. #include <Windows.h> int main() { LockWorkStation(); return 0; } Please tell me what I am missing here :( I am using MS-Visual studio 2005. Regards.

    Read the article

  • How to request Transponder list from a TV satellite

    - by Muhammad alaa
    I have a DTV-DVB Mantis BDA satellite card and I was wondering if i can use it programmatically to request a satellite transponder list throw some library or if i should create one Where should i start? I saw applications do that such as ProgDVB, but i didn't know what is the idea behind that. Another question: is there any standard that define how to communicate with Satellite TV, and if there is where i can get/read it. thank you

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >