sending custom messages

Everything else that doesn't fall into one of the other PB categories.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

sending custom messages

Post by localmotion34 »

ok, i have successfully subclassed a gadget from within a PB library with its own procedure.

here is the subclass proc:

Code: Select all

ProcedureDLL pptproc( hwnd, msg,  wParam, lParam)
  Select msg 
    Case #WM_LBUTTONUP
      pptnumber=CountList(PptLVnumber()) 
      For a=0 To pptnumber-1 
        ClearList(FindChild()) 
        EnumChildWindows_(pptLVstruct(a)\scrollareachild, @EnumChildProc(), 0) 
        ResetList(FindChild()) 
        ForEach FindChild() 
          Index = ListIndex(FindChild()) 
          If hwnd = FindChild()\childwindowhandle
            scrollareachild=pptLVstruct(a)\scrollareachild
            parenthwnd=GetWindow_(GadgetID(pptLVstruct(a)\scrollarea),#GWL_HWNDPARENT)
            SendMessage_(FindChild()\childwindowhandle,#BM_SETCHECK,#BST_UNCHECKED,0)
            SendMessage_(parenthwnd,#ppt_click,a,0)
            ForEach FindChild() 
              If hwnd <> FindChild()\childwindowhandle 
                SendMessage_(FindChild()\childwindowhandle,#BM_SETCHECK,#BST_UNCHECKED,0)
              EndIf 
            Next 
          EndIf 
        Next 
      Next 
  EndSelect  
  ProcedureReturn CallWindowProc_(GetProp_(hwnd,"OldProc"),hwnd,msg,wParam,lParam)
EndProcedure   
 
what i want to do with this custom gadget type is have PB process a click on it with something like eventgadgetid(), but SPECIFIC to this custom gadget like PPTeventID(), which returns the number powerpoint like listview clicked. i was wondering if during the subclass proc i can do this:

parenthwnd=GetWindow_(GadgetID(pptLVstruct(a)\scrollarea),#GWL_HWNDPARENT)

sendmessage_(parenthwnd,#powerpointclick,0,numberpowerpointlistview)

and in the main PB loop do:

select waitwindowevent()
case #powerpointclick
select ppteventid();this goes and gets numberpowerpointlistview
case 0
case 1

nopw i know this can be done, as there is a command EventPopUpWindowID() that retieves the popup window that fired the event.

is it possible to send and process CUSTOM messages, or can anyone give me suggestions?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw