• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About stickman

  • Rank
  1. Dialog editbox selection

    ok i have been fooling around with it abit... i made a menu item so that when i click inside the editbox the on the menu item EM_SETSEL on the editbox and it selected the text! so i think this is a wierd FOCUS problem and my editbox doesn't have focus. is there a call i can make to give my editbox focus? when i run my program its the first box selected but i think i still need to send a focus message to make it work. i have tried SendMessage(hwndAddress,EM_SETFOCUS,0,0); but it doens't work.
  2. Dialog editbox selection

    ok the (int) thing has no affect, and it wasn't in the examples anyway. basically that select thing i got outa an example... but it doesn't work for me. im using it for a gui using embedded visual c++ and smartphone 2003. it doesn't have a SAVESEL, but it has a NOHIDE option which is exactly the same i think and it doesn't do anything either. the problem is this is a requirement for my project and i cant get it to WORK! arg!
  3. Dialog editbox selection

    ok i have an editbox on my dialog... and in my init dialog procedure i put some text into it, but i also want to have all the text selected. when the code below is run it simply moves the cursor to the end of editbox... so like this: "some text|" i tried it with other values but it still just moves the cursor and doesn't select anything... pwease help! BOOL OnInitDialog(LPARAM lParam) { HWND hwndAddress; SetDlgItemText(IDC_PING_ADDRESS, _T("some text")); VERIFY(hwndAddress= GetDlgItem(IDC_PING_ADDRESS)); SendMessage(hwndAddress,EM_SETSEL,(WPARAM)0,(LPARAM)-1); } and here is how my dialog is made in the .rc IDD_PING DIALOG DISCARDABLE 0, 0, 101, 89 style DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Ping" FONT 11, "Nina" BEGIN LTEXT "Domain/IP Address:",IDC_STATIC,3,0,95,8 EDITTEXT IDC_PING_ADDRESS,3,8,95,12,ES_AUTOHSCROLL | NOT WS_BORDER LTEXT "Timeout (ms):",IDC_STATIC,3,20,95,8 EDITTEXT IDC_PING_PERIOD,3,28,95,12,ES_AUTOHSCROLL | ES_NUMBER | NOT WS_BORDER LTEXT "Number of Pings:",IDC_STATIC,3,40,95,8 EDITTEXT IDC_PING_NUMBER,3,48,95,12,ES_AUTOHSCROLL | ES_NUMBER | NOT WS_BORDER END
  4. loadstring() and hinstance :(

    wow. u own! thanx!
  5. ok basically i have to do something using WTL and C++... i have a window that links to a bunch of dialogs and things for my program... and in those dialogs i use lists. now these lists have strings in them that i need to fetch from my String Table Resource. before i could use this: LoadString(hInstance, IDS_SOME_TITLE, buffer, 0); but now that the dialogs are all split up into their own classes i dont know how to get the hInstance to pass to the loadstring function. is there a way to get hInstance? some function or something. Or maybe there is a "proper" way of doing this?
  6. here is my resource file with my dialog + listbox IDD_MAINDIALOG DIALOG DISCARDABLE 0, 0, 101, 89 style WS_POPUP | WS_VISIBLE FONT 11, "Nina" BEGIN LISTBOX IDC_LIST1,3,3,95,78,LBS_NOINTEGRALHEIGHT | LBS_WANTKEYBOARDINPUT | NOT WS_BORDER | WS_TABSTOP END here is where i make my dialog hBaseDialog = CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_MAINDIALOG), hwndMain, (DLGPROC)DialogProc); and here is the DialogProc i made BOOL CALLBACK DialogProc(const HWND hDlg, const UINT uiMessage, const WPARAM wParam, const LPARAM lParam) { BOOL bProcessedMsg = true; HWND hwndProgramList; switch(uiMessage) { case WM_INITDIALOG: InitDialog (hDlg); VERIFY(hwndProgramList = GetDlgItem(hDlg, IDC_LIST1)); FillPrograms(hwndProgramList); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDM_CLOSEWIN_EXIT: // fall through: case IDCANCEL: DestroyWindow(hDlg); break; default: // nothing was processed bProcessedMsg = false; break; } break; case WM_VKEYTOITEM: MessageBox(hDlg,TEXT("hi"),TEXT("hi"),MB_OK); break; case WM_KEYDOWN: MessageBox(hDlg,TEXT("hi"),TEXT("hi"),MB_OK); break; case WM_DESTROY: // Destroy the parent window to exit the app DestroyWindow(GetParent(hDlg)); break; case WM_CLOSE: DestroyWindow(hDlg); break; default: // nothing was processed bProcessedMsg = false; break; } return bProcessedMsg; } so anyway my problem is i cannot capture input form the keyboard... both the WM_KEYDOWN and the WM_VKEYTOITEM are skipped... the only message i have managed to get from this is an IDOK... and i dont even know what that is for...
  7. casting strings to structs? pwease help

    i have not fully read the serialization stuff yet so im hoping its what i was looking for. basically i wanna make a muliplayer game and i need to send structures back and forth. and the thingy for sending msg's over the network only take strings so i need to put the structs into strings and reconstruct them on the other side.
  8. ok so basically im sending a string... so i need to be able to stuff a struct into a string and to get a struct outa a string. can anyone tell me how this is done in c++. ill just give u the thingies... struct Tank { int c_x,c_y,c_z; int d_x,d_y,d_z; }; Tank tank; string s; so i need to put "tank" into "s". if i receive a string "t" i need to store it... so. Tank tank2 = (some kinda casting thing)t; can someone help noobie me.
  9. DirectPlay dx9 help a newbie PLZ

    Quote:Original post by hplus0603 DirectPlay has been obsoleted by Microsoft. It is no longer supported or included. Possible alternative libraries can be found in the Multiplayer and Networking forum FAQ. Sounds like something like OpenTNL or RakNet would be what you want. thanx, i think i will go with the RakNet hopefully lotsa people use it here and can help a newbie :)
  10. DirectPlay dx9 help a newbie PLZ

    i have the october version... i really need those tutorials cause im a complete noobie so ill uninstall and get the older ones if i can
  11. ya so i plan on making a game for my project at school and i wanan get a head start over christmas break. SO... i found out directplay can help me handle all my client server needs and it supposidly has some nice tutorials... one problem... i downloaded dx9 sdk... and... WHERE IS directplay? everwhere i go on MSDN in directplay it says download the dx9 SDK and go here... (SDK root)\Samples\C++\DirectPlay\Tutorials except when i installed mine it didn't come with a directplay folder... and i check the install opions and there is nothing there... all it has is DirectSound, DIrect32, and DirectInput. can someone tell me how to properly do this, or where i shoudl go to get DirectPlay... and remember im new (so if i gotta uninstall stuff or something plz tell me everything, dont assume i know what to do) thanx in advance.
  • Advertisement