Search Results

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

Page 2/30 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Help with GetGlyphOutline function(WinAPI)

    - by user146780
    I want to use this function to get contours and within these contours, I want to get cubic bezier. I think I have to call it with GGO_BEZIER. What puzzles me is how the return buffer works. "A glyph outline is returned as a series of one or more contours defined by a TTPOLYGONHEADER structure followed by one or more curves. Each curve in the contour is defined by a TTPOLYCURVE structure followed by a number of POINTFX data points. POINTFX points are absolute positions, not relative moves. The starting point of a contour is given by the pfxStart member of the TTPOLYGONHEADER structure. The starting point of each curve is the last point of the previous curve or the starting point of the contour. The count of data points in a curve is stored in the cpfx member of TTPOLYCURVE structure. The size of each contour in the buffer, in bytes, is stored in the cb member of TTPOLYGONHEADER structure. Additional curve definitions are packed into the buffer following preceding curves and additional contours are packed into the buffer following preceding contours. The buffer contains as many contours as fit within the buffer returned by GetGlyphOutline." I'm really not sure how to access the contours. I know that I can change a pointer another type of pointer but i'm not sure how I go about getting the contours based on this documentation. Thanks

    Read the article

  • C++ - Basic WinAPI question

    - by HardCoder1986
    Hello! I am now working on a some sort of a game engine and I had an idea to put everything engine-related into a static library and then link it to my actual problem. Right now I achieved it and actually link that library and every functions seem to work fine, except those, which are windows-related. I have a chunk of code in my library that looks like this: hWnd = CreateWindow(className, "Name", WS_OVERLAPPED | WS_CAPTION | WS_EX_TOPMOST, 0, 0, 800, 600, NULL, NULL, GetModuleHandle(NULL), this); if (hWnd) { ShowWindow(hWnd, SW_NORMAL); UpdateWindow(hWnd); } else { MessageBox(NULL, "Internal program error", "Error", MB_OK | MB_ICONERROR); return; } When this code was not in the library, but in the actual project, it worked fine, created the window and everything was ok. Right now (when I'm linking to my library that contains this code) CreateWindow(...) call returns NULL and GetLastError() returns "Operation succesfully completed" (wtf?). Could anybody help me with this? Is it possible to create a window and display it using a static library call and why could my code fail? Thank you.

    Read the article

  • searching for hidden files using winapi

    - by Kristian
    HI i want to search for a hidden files and directories in a specefic given path but I don't know how to do it for hidden files i do know how to search for normal files and dir i did this code but im stuck can't make it search for only hidden files #include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { TCHAR *fn; fn=L"d:\\*"; HANDLE f; WIN32_FIND_DATA data; { FILE_ATTRIBUTE_HIDDEN; } f=FindFirstFile(fn,&data); if(f==INVALID_HANDLE_VALUE){ printf("not found\n"); return 0; } else{ _tprintf(L"found this file: %s\n",data.cFileName); while(FindNextFile(f,&data)){ _tprintf(L"found this file: %s\n",data.cFileName); } } FindClose(f); return 0; }

    Read the article

  • Transparent BITMAP WinAPI

    - by user146780
    I want to implement a layering system in my application and was thinking of creating a bunch of trabsparent bitmaps, adding content to them then blitting them on top of each other, how can this be done without setting each pixel to (0,0,0,0). I'm using Pure win32, not MFC, thanks.

    Read the article

  • Help with WinAPI scroll bars

    - by user146780
    Right now I have a window with horizontal ad vertical scrollbars. I use these parameters to initialize it. //Set OGL Frame scroll bar SCROLLINFO inf; inf.cbSize = sizeof(SCROLLINFO); inf.fMask = SIF_PAGE | SIF_POS; inf.nPage = 20; inf.nPos = 30; It creates them in the center and I like their size, but when I scroll I multiply by 50 which creates chopiness. How could I add more resolution to the bars and still keep the same thumb size. Is there a way I can calculate the size and position of the bar based on the above parameters? Thanks

    Read the article

  • delete,copy,rename files and directories in WINAPI ..?

    - by Kristian
    hi I made a code that search in a givin path for a certain file name or folder and print the value BUT now how can i modify it to instead of printing its name perform on of the operations ( delete,copy,rename ) I searched on google and found nothin. #include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { TCHAR *fn; fn=L"d:\\*"; HANDLE f; WIN32_FIND_DATA data; f=FindFirstFile(fn,&data); if(f==INVALID_HANDLE_VALUE){ printf("not found\n"); return 0; } else{ _tprintf(L"found this file: %s\n",data.cFileName); } while(FindNextFile(f,&data)){ { _tprintf(L"found this file: %s\n",data.cFileName); } } } FindClose(f); return 0; }

    Read the article

  • Application window as polygon texture?

    - by nekome
    Is there a way, or method, to have some application rendered as texture in 3D scene on some polygon, and also have full interactivity with it? I'm talking about Windows platform, and maybe OpenGL but I guess it doesn't matter is it OGL or DX. For example: I run Calculator using WINAPI functions (preferably hidden, not showing on desktop) and I want to render it inside 3D scene on some polygon but still be able to type or click buttons and have it respond. My idea to realize this is to have WINAPI take screenshot (or render it to memory if possible) of that Calculator and pass it to OpenGL as texture for each frame (I'm experimenting with SDL through pygame) and for mouse interactivity to use coordination translation and calculate where on application window it would act, and then use WINAPI functions such as SetCursorPos to set cursor ant others to simulate click or something else. I haven't found any tutorials with topic similar to this one. Am I on a right track? Is there better way to do this if possible at all?

    Read the article

  • WINAPI beginner guidance question

    - by gekod
    I'm learning to develop windows applications using WINAPI and plain C. Now I got a bit confused with all those handles and would like to ask if you guys could teach me some good practices to structure and handle controls and windows. Here's where I get confused: Using the IDs declared in the resources for each object, we can get their handles using GetDlgItem(). Now what if we don't know their parent, which is needed by this function. One example: We have the main window created at launch. Then we register two new window classes and create a window for each new class and we create a message function for each too. Now if inside one of the children windows I create a button and inside the other child window I create a text label. Now when we click the button inside of child window A the label in child window B shall be modified to whatever. The WM_COMMAND for the button is interpreted inside the message loop for child window A. Now what would be the best and more elegant way to access the text label inside the child window B? I am in the process of learning the WINAPI and just want to learn it right from the start instead of producing Hacked code that someday becomes unreadable and to later have to adapt to a new way of programing.

    Read the article

  • WINAPI window management question

    - by gekod
    I'm learning to develop windows applications using WINAPI and plain C. Now I got a bit confused with all those handles and would like to ask if you guys could teach me some good practices to structure and handle controls and windows. Here's where I get confused: Using the IDs declared in the resources for each object, we can get their handles using GetDlgItem(). Now what if we don't know their parent, which is needed by this function. One example: We have the main window created at launch. Then we register two new window classes and create a window for each new class and we create a message function for each too. Now if inside one of the children windows I create a button and inside the other child window I create a text label. Now when we click the button inside of child window A the label in child window B shall be modified to whatever. The WM_COMMAND for the button is interpreted inside the message loop for child window A. Now what would be the best and more elegant way to access the text label inside the child window B? I am in the process of learning the WINAPI and just want to learn it right from the start instead of producing Hacked code that someday becomes unreadable and to later have to adapt to a new way of programing.

    Read the article

  • WinAPI window taking 50% of CPU when idle

    - by henryprescott
    I'm currently working on a game that creates a window using WindowsAPI. However, at the moment the process is taking up 50% of my CPU. All I am doing is creating the window and looping using the code found below: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { MSG message = {0}; WNDCLASSEX wcl = {0}; wcl.cbSize = sizeof(wcl); wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; wcl.lpfnWndProc = WindowProc; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; wcl.hInstance = hInstance = hInstance; wcl.hIcon = LoadIcon(0, IDI_APPLICATION); wcl.hCursor = LoadCursor(0, IDC_ARROW); wcl.hbrBackground = 0; wcl.lpszMenuName = 0; wcl.lpszClassName = "GL2WindowClass"; wcl.hIconSm = 0; if (!RegisterClassEx(&wcl)) return 0; hWnd = CreateAppWindow(wcl, "Application"); if (hWnd) { if (Init()) { ShowWindow(hWnd, nShowCmd); UpdateWindow(hWnd); while (true) { while (PeekMessage(&message, 0, 0, 0, PM_REMOVE)) { if (message.message == WM_QUIT) break; TranslateMessage(&message); DispatchMessage(&message); } if (message.message == WM_QUIT) break; if (hasFocus) { elapsedTime = GetElapsedTimeInSeconds(); lastEarth += elapsedTime; lastUpdate += elapsedTime; lastFrame += elapsedTime; lastParticle += elapsedTime; if(lastUpdate >= (1.0f / 100.0f)) { Update(lastUpdate); lastUpdate = 0; } if(lastFrame >= (1.0f / 60.0f)) { UpdateFrameRate(lastFrame); lastFrame = 0; Render(); SwapBuffers(hDC); } if(lastEarth >= (1.0f / 10.0f)) { UpdateEarthAnimation(); lastEarth = 0; } if(lastParticle >= (1.0f / 30.0f)) { particleManager->rightBooster->Update(); particleManager->rightBoosterSmoke->Update(); particleManager->leftBooster->Update(); particleManager->leftBoosterSmoke->Update(); particleManager->breakUp->Update(); lastParticle = 0; } } else { WaitMessage(); } } } Cleanup(); UnregisterClass(wcl.lpszClassName, hInstance); } return static_cast<int>(message.wParam); } So even when I am not drawing anything when the window has focus it still takes up 50%. I don't understand how this is taking up so much system resources. Am I doing something wrong? Any help would be much appreciated, thank you!

    Read the article

  • Launch external application from C++ program and attach it to visual 2008 debugger while debugging host in WinAPI

    - by PiotrK
    Basically I have Host and Child program. I do not have sources for Child so I can't change anything in it. I want to launch Host from debugger, which at some point should launch Child program. I want to attach Child automatically for debugging session as well (so any breakpoints set in DLL sources loaded under Child process will hit). How to do this in Visual Studio 2008 C++ with standard WinAPI? I tried this: SHELLEXECUTEINFO sei = {0}; sei.cbSize = sizeof (SHELLEXECUTEINFO); sei.fMask = SEE_MASK_NOCLOSEPROCESS; sei.lpVerb = "open"; sei.lpFile = "Child.exe"; sei.lpParameters = "/Param"; sei.nShow = SW_SHOWNORMAL; if (ShellExecuteEx (&sei)) { WaitForSingleObject (sei.hProcess, INFINITE); } But this does not attach debugger for Child.exe

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >