- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 79
- Posts with Upvotes
- 74
- Upvoting Members
- 41
- Downvotes Received
- 11
- Posts with Downvotes
- 8
- Downvoting Members
- 10
i build a class for create a static control(label). and i't cool. but why the SetTextColor() and SetBkColor() are ignored? case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(inst->hwnd, &ps); // TODO: Add any drawing code here... SetBkColor(hdc, RGB(0,255,0)); SetBkMode(hdc,TRANSPARENT); SetWindowText(inst->hwnd,"hello"); EndPaint(inst->hwnd, &ps); } the inst is the class(label) pointer … |
|
I have to create a program that asks a person to enter a 2 digit number (10-99) and convert it into words. I've been working on this for days and I still don't see what I'm doing wrong! PLEASE HELP ME!!! EXAMPLE: 27 twenty-seven [CODE]#include <iostream> using namespace std; int … |
|
I have an HDC file(that is taken by screen that I want to save it to any image file (prefer Bmp) , the thing is I don't really know the format and any function that I find for saving takes to many function inputs (that must be maximum 2). Any … |
|
using: char username[255+1]; DWORD username_len = 255+1; GetUserName(username, &username_len); i get the actual user name. but how can i get the program folder name for execute a program? the '%ProgramFiles(x86)%' on folder name string is ignored :( |
|
I'm pretty good with Java but I would like to learn to create interesting things with C++ or C. At the moment I have to ask: Why do all of these IDE's and libraries make it so damn difficult to set up an environment for programming? Personally I believe programming … |
|
So I'm working with time.h for this (copied from msdn): int main( void ) { struct tm newtime; char am_pm[] = "AM"; __time64_t long_time; char timebuf[26]; errno_t err; // Get time as 64-bit integer. _time64( &long_time ); // Convert to local time. err = _localtime64_s( &newtime, &long_time ); if (err) … |
|
i have these code for save a structure data to a file and then read it: struct user { string name; image foto; string adress; int age; }; user usrName={"joaquim",image("C:\\Nova pasta\\acrobat.bmp"), "viseu",32}; user usrName2; FILE* f = fopen("C:\\Nova pasta\\username1.dat", "w+b"); if(f==NULL) DebugText("error"); fwrite(&usrName, sizeof( user), 1, f); fseek(f, 0, SEEK_SET); … |
|
Write a C++ program to determine a student's grade. It reads three test scores (between 0 and 100) and calculates the average score and converts it to a letter grade. Grade Conversion Rules: rule a. If the average score is 90 or more the grade is 'A'. rule b. If … |
|
Hi there, well, i have homework of packet sniffing software i'm not suppose to write the code,but i need to make a report of an existing code and explain it in details. I found the following code somewhere(the code should be of a packet sniffer) ,but i couldn't run it.I … |
|
see my MemoryDc and BitmapDC class's: class MemoryDC { private: HDC memoryDC; public: MemoryDC () { HDC hdc=GetDC(GetDesktopWindow()); memoryDC=CreateCompatibleDC(hdc); ReleaseDC(GetDesktopWindow(),hdc); } operator HDC() const { return memoryDC; } ~MemoryDC () { DeleteDC(memoryDC); } }; class BitmapDC { private: MemoryDC hdcbitmap; HGDIOBJ bitmapold; HBITMAP bitmapcurrent; int intwidth; int intheight; void init(int … |
|
can i print a window without printer dialog? |
|
I have an image (frame.bmp, uncompressed, resolution 640*480, 3bit depth, 900KB size) stored at C:\Frame.bmp. I want to load it and put it in my program as an array a[N][M], N=479, M=639. After that to modify its elements (e.g thresholding) and create a new array B[479][639]. Finally, to store it … |
|
i'm getting flickers on windows. the windows have CW_USEDEFAULT size and i use the WS_CLIPCHILDREN. on WM_PAINT i use my image class with client rect size. it's big. but not more big than screen. the WM_PAINT: case WM_ERASEBKGND: { return (LRESULT)1;; } break; case WM_PAINT: { PAINTSTRUCT ps; BeginPaint(inst->hwnd, &ps); … |
|
i know get the windows taskbar HWND: HWND GetDesktopToolBar() { return FindWindow("Shell_Traywnd", ""); } now i can do: 1 - add controls on left side(close to Start Button)... but the click messages isn't working. maybe because use the form messages procedure. can anyone correct me?; 2 - enable\visible it. but, … |
|
heres my function for select the font: CHOOSEFONT ShowSelectFont(HWND hwnd=GetForegroundWindow()) { CHOOSEFONT cf = {sizeof(CHOOSEFONT)}; LOGFONT lf; cf.Flags = CF_EFFECTS | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS; cf.hwndOwner = hwnd; cf.lpLogFont = &lf; cf.rgbColors = RGB(0,0,0); cf.lpLogFont->lfStrikeOut=FALSE; cf.lpLogFont->lfUnderline=FALSE; cf.lpLogFont->lfHeight=-MulDiv(12, GetDeviceCaps(GetDC(hwnd), LOGPIXELSY), 72);//change font size _tcscpy(cf.lpLogFont->lfFaceName, "Arial" ); //we must include tchar.h if(ChooseFont(&cf)) { … |
|
i have these function for get the string size: SIZE GetStringSize(string text, HWND hdccontrol=GetForegroundWindow()) { RECT textrect={0}; HDC txthdc=GetDC(hdccontrol); DrawText (txthdc,text.c_str(),-1,&textrect,DT_CALCRECT); ReleaseDC(hdccontrol,txthdc); SIZE a={textrect.right-textrect.left, textrect.bottom-textrect.top}; return a; } the 1st string size isn't correct. then i get the correct one. so why i get, sometimes, the wrong size? something to … |
|
import java.util.*; class occult { public static void main(String[] args){ int n = 2; for (int i = 0; ; i++){ if(Integer.toString(i).contains("666")){ if ( n == 1 ) System.out.println(i); n -= 1; } } } } I have written the above java code into c++ . i wanted to know … |
|
(i'm using win7) i can use the Region functions for get the transparent control. but, in some cases, i can get bad resoltes(. i have read that i can use brushes for get the transparent control. can anyone explain better? |
|
how can i copy the parent background(DC) control to child control DC? |
|
how can i make swapping for 2 variables in more than 2 ways ?? |
|
think in these way: the eyes have the blue color, the backcolor is blue. so how can i change the backcolor without change the image\eye? (these is just an exemple for trying explain) |
|
heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; int framedelay=0; string strfilename=""; Gdiplus::Color clrBackColor=Gdiplus::Color::Transparent; HDC hdcwindow; bool blnTransparent=true; HICON HICONFromHBITMAP(HBITMAP bitmap) { BITMAP bmp; GetObject(bitmap, sizeof(BITMAP), &bmp); HBITMAP … |
|
finally i have the static control transparent: //creating the form: hwnd = CreateWindowEx(0, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_TABSTOP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, mod, this); //sending a message for subclassing: case WM_CTLCOLORSTATIC: { return DefWindowProc(HandleWindow, msg, wParam, lParam); } break; //heres how i create a static control with ownerdraw style: … |
|
when the form is activated: case WM_ACTIVATE: { if (wParam==WA_INACTIVE) { SetWindowText(inst->hwnd,"unactivated"); FormActivated = NULL; } else { SetWindowText(inst->hwnd,"activated"); FormActivated = inst->hwnd; } return 0; } break; when i create the timer: case WM_CREATE: { if(WindowMain == NULL || WindowMain ==GetDesktopWindow()) { WindowMain = HandleWindow; } SetTimer(inst->hwnd,JoystickTimer,150,NULL); SetTimer(inst->hwnd,KeyBoardTimer,150,NULL); SendMessage((HWND)lParam , … |
|
How do i write a program that computes the sum of all even numbers in a range forexample between 1 and 100 |
|
Write a java program to obtain the following shape. You must use while loops in Java to generated the output. Note: The & sign is line 3 has been purposefully removed. how to do this & & & & & & & & & & & & & & & … |
|
the RegisterHotKey() is limited? everytime that i create a button control the RegisterHotKey() id isn't the same. //on constructor: ++ButtonCount; altmessage=ButtonCount; now the hotkey message: case WM_HOTKEY: { if (wParam==inst->altmessage) { SendMessage(inst->hwnd,WM_COMMAND,BN_CLICKED,lParam); } } break; and now how i regist the hot key: case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; UnregisterHotKey(inst->hwnd,inst->altmessage); … |
|
|
I'm having a problem appending `std::wstring` to my Win32 edit. It compiles without errors, but the displayed text is not what was originally in the `std::wstring`. Is there a better way to do what I'm doing(below), or should I use the RichEdit(last resort option). My appendTextToEdit function below is self-explanatory, … |
This is an project title for a c++ project given by my collage, Plz can anyone guide me with some good reference books/journals for data visualization and word image identification using image processing so i can begin my project with some kind of background study. Any help is appreciated |
|
i'm owner draw some controls. here what i use for a button: case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; HIMAGELIST imlIcon=ImageList_Create(inst->imgtest.width(),inst->imgtest.height(),ILC_COLOR,1,1); ImageList_Add(imlIcon,inst->imgtest,NULL); HTHEME hTheme = OpenThemeData(inst->hwnd, L"BUTTON"); //fill the background with button face color FillRect(test->hDC, &test->rcItem,(HBRUSH) GetSysColor(COLOR_BTNFACE)); if ( test->itemState & ODS_SELECTED) // If it is pressed { DrawEdge(test->hDC,&test->rcItem,EDGE_SUNKEN,BF_RECT); // Draw … |