Search Results

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

Page 19/30 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How do I play flash files in pure C?

    - by CDR
    As part of a customized media player written in C (Win32), I need to enable my app play flash movies (.swf files) inside the player window. Can someone please indicate the most C compatible low level way to achieve this, giving me highest control? Specially control on display window and network access. I am looking for reference to a Windows DLL like flash_player.dll (if there is such thing) with documentation. Or at least a COM/ActiveX controls. Note that ActiveX is harder to use in C, than in say VB.

    Read the article

  • C++ NetUserAdd() not working?

    - by Brett Powell
    I posted earlier about how to do this, and got some great replies, and have managed to get the code written based off the MSDN example. However, it does not seem to be working properly. Its printing out the ERROR_ACCESS_DENIED message, but im not sure why as I am running it as a full admin. I was initially trying to create a USER_PRIV_ADMIN, but the MSDN said it can only use USER_PRIV_USER, but sadly neither work. Im hoping someone can spot a mistake or has an idea. Thanks! void AddRDPUser() { USER_INFO_1 ui; DWORD dwLevel = 1; DWORD dwError = 0; NET_API_STATUS nStatus; ui.usri1_name = L"DummyUserAccount"; ui.usri1_password = L"a2cDz3rQpG8"; //ignored by NetUserAdd //ui.usri1_password_age = -1; ui.usri1_priv = USER_PRIV_USER; //USER_PRIV_ADMIN; ui.usri1_home_dir = NULL; ui.usri1_comment = NULL; ui.usri1_flags = UF_SCRIPT; ui.usri1_script_path = NULL; nStatus = NetUserAdd(NULL, dwLevel, (LPBYTE)&ui, &dwError); switch (nStatus) { case NERR_Success: { Msg("SUCCESS!\n"); break; } case NERR_InvalidComputer: { fprintf(stderr, "A system error has occurred: NERR_InvalidComputer\n"); break; } case NERR_NotPrimary: { fprintf(stderr, "A system error has occurred: NERR_NotPrimary\n"); break; } case NERR_GroupExists: { fprintf(stderr, "A system error has occurred: NERR_GroupExists\n"); break; } case NERR_UserExists: { fprintf(stderr, "A system error has occurred: NERR_UserExists\n"); break; } case NERR_PasswordTooShort: { fprintf(stderr, "A system error has occurred: NERR_PasswordTooShort\n"); break; } case ERROR_ACCESS_DENIED: { fprintf(stderr, "A system error has occurred: ERROR_ACCESS_DENIED\n"); break; } } }

    Read the article

  • Bizzare results when running two Visual Studio Express C++ 2008 solutions

    - by Jamie Keeling
    This is a follow on from my previous question although this is about something else. I've been having a problem where for some reason my message that I pass from one process to another only displays the first letter, in this case "M". My application based on a MSDN sample so to make sure I hadn't missed something I create a seperate solution, added the MSDN sample (Without any changes for my needs) and unsuprisingly it works fine. Now for the weird bit, when I run the MSDN sample running (As in debugging) and have my own application running, the text prints out fine without any problems. The second I run my on it's own without the original MSDN sample being open it fails to work and only shows an "M". I've looked in the debugger and don't seem to notice anything suspicious (It's a slightly dated picture, I've fixed the data type inconsistency). Can anyone provide a solution as to this? I've never encountered anything like this before. To look at my source code it's easier to just look at the link I posted at the top of the question, there's no point in me posting it twice. Thank you for any help.

    Read the article

  • Using CreateFileMapping between to programs - C

    - by Jamie Keeling
    Hello, I have two window form applications written in C, one holds a struct consisting of two integers, another will receive it using the CreateFileMapping. Although not directly related I want to have three events in place so each of the processes can "speak" to each other, one saying that the first program has something to pass to the second, one saying the first one has closed and another saying the second one has closed. What would be the best way about doing this exactly? I've looked at the MSDN entry for the CreateFileMapping operation but I'm still not sure as to how it should be done. I didn't want to start implementing it without having some sort of clear idea as to what I need to do. Thanks for your time.

    Read the article

  • Making two Windows using CreateWindowsEx()

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks! Edit: I've attempted to make a second window and although this does compile, no windows show atall on build. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { //Fields WCHAR buffer[256]; struct DiceData storage; HWND hwnd; // Act on current message switch(message) { case WM_CREATE: AddMenus(hMainWindow); hwnd = CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, NULL, NULL, NULL); ShowWindow(hwnd, SW_SHOW); break; Any suggestions as to why this happens?

    Read the article

  • What are the default access rights for a process started with ShellExecuteEx?

    - by Heinrich Ulbricht
    I need to perform certain operation on a process started with ShellExecuteEx like waiting for it, duplicating handles, querying and setting information etc. Now I am wondering if I can do all these things on the hProcess member which is returned in the SHELLEXECUTEINFO structure I pass. Does anybody know this? Do I have rights like PROCESS_DUP_HANDLE, SYNCHRONIZE, PROCESS_SET_INFORMATION, PROCESS_QUERY_INFORMATION and so on by default?

    Read the article

  • Python win32api not moving mouse cursor in VirtualBox

    - by wes
    I'm trying to use this Python code: import math for i in xrange(500): x = 500 + math.sin(math.pi * i / 100) * 500 y = 500 + math.cos(i) * 100 x, y = int(x), int(y) win32api.SetCursorPos((x, y)) time.sleep(.01) taken from here to move the mouse cursor in an XP VirtualBox. The mouse icon will flicker to the appropriate graphic (when it hits the edge of a window it turns into the <- resize image, for instance), but it doesn't actually move the visible cursor. I can move the mouse around while the code is running. Same result using the ctypes example in the above link. It works fine in the Win7 host. I have Guest Additions installed, if that matters.

    Read the article

  • How to lock file in Windows?

    - by matsoor
    How to lock file in Windows so that this file can be opened/read/wrote only by one process? I found out that file can be locked with CreateFile by giving 0 to dwShareMode flag. It works but only the returned handle can be used to work with file. But I want to be able to lock the file to other processes and at the same time to create multiple handles in my process. Please help me to solve this issue or give some tips...

    Read the article

  • c++ connect() keeps returning WSATIMEDOUT over internet but not localy

    - by KaiserJohaan
    Hello, For some reason, my chat application always gets WSATIMEDOUT when trying to connect to another person over the internet. int len_ip = GetWindowTextLength(GetDlgItem(hWnd,ID_EDIT_IP)); char ipBuffer[16]; SendMessage(GetDlgItem(hWnd,ID_EDIT_IP),WM_GETTEXT,16,(LPARAM)ipBuffer); long host_ip = inet_addr(ipBuffer); int initializeConnection(long host_ip, HWND hWnd) { // initialize winsock WSADATA wdata; int result = WSAStartup(MAKEWORD(2,2),&wdata); if (result != 0) { return 0; } // setup socket tcp_sock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); if (tcp_sock == INVALID_SOCKET) { return 0; } // setup socket address SOCKADDR_IN tcp_sock_addr; tcp_sock_addr.sin_family = AF_INET; tcp_sock_addr.sin_port = SERVER_TCP_PORT; tcp_sock_addr.sin_addr.s_addr = host_ip; // connect to server if (connect(tcp_sock,(SOCKADDR*)&tcp_sock_addr,sizeof(tcp_sock_addr)) == SOCKET_ERROR) { return 0; } HRESULT hr = WSAGetLastError(); // set socket in asynchronous mode if (WSAAsyncSelect(tcp_sock,hWnd,SOCKET_TCP, FD_READ | FD_WRITE | FD_CONNECT | FD_CLOSE) == SOCKET_ERROR) { return 0; } return 1; } For some reason it works perfectly fine on local network between computers, but totally screws up over the internet. WSATIMEDOUT is always returned (not connection refused, so its not a port problem). It makes me believe something is wrong with the IP but why on earth can it work on local addresses (like 192.168.2.4) Any ideas? Cheers

    Read the article

  • Is there any way to determine what type of memory the segments returned by VirtualQuery() are?

    - by bdbaddog
    Greetings, I'm able to walk a processes memory map using logic like this: MEMORY_BASIC_INFORMATION mbi; void *lpAddress=(void*)0; while (VirtualQuery(lpAddress,&mbi,sizeof(mbi))) { fprintf(fptr,"Mem base:%-10x start:%-10x Size:%-10x Type:%-10x State:%-10x\n", mbi.AllocationBase, mbi.BaseAddress, mbi.RegionSize, mbi.Type,mbi.State); lpAddress=(void *)((unsigned int)mbi.BaseAddress + (unsigned int)mbi.RegionSize); } I'd like to know if a given segment is used for static allocation, stack, and/or heap and/or other? Is there any way to determine that?

    Read the article

  • EnumJobs not returning Copies & Total Pages

    - by Hein du Plessis
    I'm using Windows API's EnumJobs to find the PageCount and Copies of a print job, but I found that these fields are almost always zero when called on a print server. Although it could be my timing is out, because the number of pages increment as the job prints and once it's done the print job cannot be accessed. So there is about half a nanosecond when the values in EnumJobs is correct before it dissapears. I've been scouring the web but can't find any help on this, just other people with similar problems. Anybody with experience with EnumJobs or can suggest other means of determining the total number of pages printed?

    Read the article

  • How can I debug a win32 process that unexpectedly terminates silently?

    - by Matthew Xavier
    I have a Windows application written in C++ that occasionally evaporates. I use the word evaporate because there is nothing left behind: no "we're sorry" message from Windows, no crash dump from the Dr. Watson facility... On the one occasion the crash occurred under the debugger, the debugger did not break---it showed the application still running. When I manually paused execution, I found that my process no longer had any threads. How can I capture the reason this process is terminating?

    Read the article

  • How to send message from one dialog to another?

    - by zim22
    Hi! I was given a task. First dialog based application has 4 buttons (up, down, left, right). Second dialog based application has two controls (e.g. text area, button). When on the first dialog I click "left" button - controls on the second dialog must move to the left. But unfortunately I don't know Win32 API at all. How can I implement it? What kind of Win32 API mechanism should I be using? Thanks.

    Read the article

  • How to call window developed in C# through FindWindow api.

    - by Sagar Mane
    Hello All, I am new to C# and xaml code. I have one sample code which implemented in C#. when I have reviewed xaml file I got <Window x:Class="test.MainWindow">. So does test.MainWindow indicate the class name for this window. I am trying to invoke this window from other application which is developed in win 32. I am trying to pass this class name to FindWindow("test.MainWindow",NULL) ,but it fails. does anything missing over there. how I can change the class name of window developed in C#? Thanks, Sagar

    Read the article

  • Multimonitor taskbar in .Net

    - by kalan
    I have an idea to write a multimotor taskbar application in c# for windows xp. So, does anyone have any information how to put a taskbar on the second monitor, to make it use windows styles, to prevent aplications running on the second monitor to appear in default taskbar, so on... Any help would be ...helpful )))

    Read the article

  • Raising event on reading file?

    - by blez
    I have external app reading files, I want to hook that to get event in my app. But I cannot find a sources hooking ReadFile (or something else that can help me achieve that). Any ideas how to do that? It must be done in User-Mode. I was thinking for something similar to Process Monitor. I wonder how it does it..

    Read the article

  • waveInProc / Windows audio question...

    - by BTR
    I'm using the Windows API to get audio input. I've followed all the steps on MSDN and managed to record audio to a WAV file. No problem. I'm using multiple buffers and all that. I'd like to do more with the buffers than simply write to a file, so now I've got a callback set up. It works great and I'm getting the data, but I'm not sure what to do with it once I have it. Here's my callback... everything here works: // Media API callback void CALLBACK AudioRecorder::waveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { // Data received if (uMsg == WIM_DATA) { // Get wav header LPWAVEHDR mBuffer = (WAVEHDR *)dwParam1; // Now what? for (unsigned i = 0; i != mBuffer->dwBytesRecorded; ++i) { // I can see the char, how do get them into my file and audio buffers? cout << mBuffer->lpData[i] << "\n"; } // Re-use buffer mResultHnd = waveInAddBuffer(hWaveIn, mBuffer, sizeof(mInputBuffer[0])); // mInputBuffer is a const WAVEHDR * } } // waveInOpen cannot use an instance method as its callback, // so we create a static method which calls the instance version void CALLBACK AudioRecorder::staticWaveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { // Call instance version of method reinterpret_cast<AudioRecorder *>(dwParam1)->waveInProc(hWaveIn, uMsg, dwInstance, dwParam1, dwParam2); } Like I said, it works great, but I'm trying to do the following: Convert the data to short and copy into an array Convert the data to float and copy into an array Copy the data to a larger char array which I'll write into a WAV Relay the data to an arbitrary output device I've worked with FMOD a lot and I'm familiar with interleaving and all that. But FMOD dishes everything out as floats. In this case, I'm going the other way. I guess I'm basically just looking for resources on how to go from LPSTR to short, float, and unsigned char. Thanks much in advance!

    Read the article

  • How to launch a Windows process as 64-bit from 32-bit code?

    - by Jonas
    To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do this trick: ShellExecute(hWnd, "runas" /* display UAC prompt on Vista */, windir + "\\Reg", "add HKLM\\Software\\Company\\KeyName /v valueName /t REG_MULTI_TZ /d ValueData", NULL, SW_HIDE); This solution works fine, besides that our application is a 32-bit one, and it runs the REG.EXE command as it would be a 32-bit app using the WOW compatibility layer! :( If REG.EXE is ran from the command line, it's properly ran in 64-bit mode. This matters, because if it's ran as a 32-bit app, the registry keys will end up in the wrong place due to registry reflection. So is there any way to launch a 64-bit app programmatically from a 32-bit app and not have it run using the WOW64 subsystem like its parent 32-bit process (i.e. a "*" suffix in the Task Manager)?

    Read the article

  • C++, WCHAR[] to std::cout and comparision

    - by michal
    Hi, I need to put WCHAR[] to std::cout ... It is a part of PWLAN_CONNECTION_NOTIFICATION_DATA passed from Native Wifi API callback. I tried simply std::cout << var; but it prints out the numeric address of first char. the comparision (var == L"some text") doesn't work either. The debugger returns the expected value, however the comparision returns 0. How can I convert this array to a standard string(std::string)? Thanks in advance

    Read the article

  • Are there Windows API binaries for Subversion or do I have to build SVN to call the API from Windows

    - by JeffH
    I want to call a Subversion API from a Visual Studio 2003 C++ project. I know there are threads here, here, here, and here that tell how to get started with C#.NET on Windows (the consensus seems to be SharpSvn, which I've used easily and successfully on another project) but that's not what I want. I've read the chapter on using APIs in the red-bean book which says: Subversion is primarily a set of C libraries, with header (.h) files that live in the subversion/include directory of the source tree. These headers are copied into your system locations (e.g., /usr/local/include) when you build and install Subversion itself from source. These headers represent the entirety of the functions and types meant to be accessible by users of the Subversion libraries. I'd like to use CollabNet Subversion but there doesn't seem to be API binary downloads, and I'd just as soon not build the whole thing if I can avoid it. Considering another approach, I found RapidSVN's C++ API, but it doesn't appear to offer Windows API binaries either and seems to require building SVN (which I would be willing to do as a last choice if RapidSVN's API is higher-level than the stock SVN offering.) Does calling the API from C++ in Windows have to be this much more work compared to using SharpSvn under .NET, or is there something I haven't found that would help me achieve my goal?

    Read the article

  • How to get only USB devices not all the devices in the system

    - by new
    Grretings to all, I get devices list from the system. but i am not sure that if i want to get only the usb devices currently in the system means , What class i must specify in the below code ( DWORD Flags ) hDevInfo = SetupDiGetClassDevs(&GUID_DEVINTERFACE_USB_DEVICE, 0, // Enumerator 0, DIGCF_PRESENT | DIGCF_INTERFACEDEVICE );

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >