Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: MasterDucky

Page 1 of 9 1 2 3 4

Search: Search took 0.02 seconds; generated 6 minute(s) ago.

  1. Replies
    5
    Views
    2,142

    Re: WM_KEYDOWN and focus

    It worked. :) Thank you.

    First I put it in the case that called the play() in the menu not on the button that's why it didn't work.
  2. Replies
    5
    Views
    2,142

    Re: WM_KEYDOWN and focus

    Yes but I need to push that button to start the application. After that on the other hand I want to handle WM_KEYDOWN messages.

    But since the focus stays on the button I dont get the WM_KEYDOWN...
  3. Replies
    5
    Views
    2,142

    WM_KEYDOWN and focus

    If I click on a button then it will keep the focus and I won't get any WM_KEYDOWN messages any more as long as I dont click outside and then back on the window.

    What is the cause of this behaviour...
  4. Replies
    3
    Views
    1,265

    Re: WndProc break or return

    Thank you.
  5. Replies
    3
    Views
    1,265

    WndProc break or return

    In the Charles Petzold C++ book examples the cases in the switch (message) are returning return 0;

    But if I create a project in Visual Studio 2010 it puts breaks; instead of return 0;

    Whats up...
  6. Replies
    4
    Views
    1,368

    Re: Already defined function error LNK2005

    That was it! Thanks a lot, you made my day! :wave:
  7. Replies
    4
    Views
    1,368

    Re: Already defined function error LNK2005

    Its apparently not defined there and even if I change the function name I get the same error.



    // stdafx.h : include file for standard system include files,
    // or project specific include...
  8. Replies
    4
    Views
    1,368

    Already defined function error LNK2005

    I created a very simple c++ win32 project in MSVC 2010.

    I added a .cpp file with the function definition and a .h file with the function prototype and I get this "function already defined" error....
  9. Replies
    24
    Views
    9,569

    Re: PostMessage

    It's a pity it's in MFC but Im gonna check it out nevertheless, thank you Arjay.
  10. Replies
    24
    Views
    9,569

    Re: PostMessage

    Thanks, that's a good tip!

    Interesting that PostMessage can take a string* directly but SendMessage cannot.
  11. Replies
    24
    Views
    9,569

    Re: PostMessage

    Mea culpa, I forgot a 'delete pItem;' at the end of another thread, that was it! :)
  12. Replies
    24
    Views
    9,569

    Re: PostMessage

    It's ANSI.

    Yes I definitely need to learn to debug first.
  13. Replies
    24
    Views
    9,569

    Re: PostMessage

    No, I havent. I use codeblocks with MSVC 2010 and single file debugging is not supported. I know its lame but I dont like to create a project for every little program I use. :)
  14. Replies
    24
    Views
    9,569

    Re: PostMessage

    string str;
    stringstream ss(s);

    while (getline(ss, str, '?'))
    {
    TCHAR* pItem = new TCHAR[MAX_PATH];
    lstrcpy(pItem, (TCHAR*)str.c_str());
    ...
  15. Replies
    24
    Views
    9,569

    Re: PostMessage

    Thanks, I did, it compiles but crashing.

    This is what you meant?

    case WM_USERDEFINED:
    {
    TCHAR * pItem = (TCHAR*)wParam;
    SendMessage(hListBox, LB_ADDSTRING, (WPARAM)0,...
  16. Replies
    24
    Views
    9,569

    Re: PostMessage

    Thanks for pointing this out.

    I changed my code accordingly but since I cannot declare the pointer inside 'case WM_USERDEFINED:' I have to declare it outside of the 'switch (Msg)' and it's...
  17. Replies
    24
    Views
    9,569

    Re: PostMessage

    It works with SendMessage but I was advised to use PostMessage from a thread instead.

    It works also with declaring and deleting the string buffer in every loop but I thought it was an overkill.
    ...
  18. Replies
    24
    Views
    9,569

    PostMessage

    I found a very strange behaviour.
    Im sending a message from a worker thread to the main window.
    If I uncomment the 'cout' line its working properly main window gets all the strings Im sending.
    But...
  19. Replies
    7
    Views
    2,458

    Re: Remove focus in ownerdrawn listbox

    Thanks Victor, that's working perfectly. :thumb:
  20. Replies
    7
    Views
    2,458

    Re: Remove focus in ownerdrawn listbox

    That was it, thank you for the explanation.

    But on the other hand Vitor, if I replace SendMessage with PostMessage as you told me, nothing will be printed in the ListBox.

    Any idea why?
  21. Replies
    7
    Views
    2,458

    Re: Remove focus in ownerdrawn listbox

    Thanks!


    #define UNICODE 1

    #include <Windows.h>
    #include <tchar.h>
    #include <iostream>
    using namespace std;
  22. Replies
    5
    Views
    944

    Re: Ownerdrawn ListBox and LB_ADDSTRING

    Yes, that was it, thanks.
  23. Replies
    5
    Views
    944

    Re: Ownerdrawn ListBox and LB_ADDSTRING

    If I change it to PostMessage it wont draw any text.
  24. Replies
    7
    Views
    2,458

    Remove focus in ownerdrawn listbox

    This is how I set focus:


    if (pdis->itemState & ODS_FOCUS)
    {
    DrawFocusRect(pdis->hDC, &pdis->rcItem);

    }

    but when I want to set focus...
  25. Replies
    5
    Views
    944

    Ownerdrawn ListBox and LB_ADDSTRING

    Why cant I use LB_ADDSTRING with the LBS_OWNERDRAWFIXED style?

    If I remove it it works.


    #include <Windows.h>
    #define ID_LISTBOX 162
    HWND hListBox = NULL;
    PDRAWITEMSTRUCT pdis;
Results 1 to 25 of 221
Page 1 of 9 1 2 3 4


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center