PowerBASIC Peer Support Forums
 

Go Back   PowerBASIC Peer Support Forums > User to user Discussions > PowerBASIC for Windows

PowerBASIC for Windows User to user discussions about the PB/Win (formerly PB/DLL) product line. Discussion topics include PowerBASIC Forms, PowerGEN and PowerTree for Windows.

Reply
 
Thread Tools Display Modes
  #1  
Old Jan 6th, 2012, 09:31 AM
Steve Bouffe Steve Bouffe is offline
Member
 
Join Date: May 1999
Location: Chelmsford Essex, UK
Posts: 802
%mm_mcinotify

Hi,

Been looking around the forum but cant find the answer.

Can I include a value in the call of

MCISENDSTRING( "play mp3 notify", "", 0, hDlg )

So if I'm playing 2 mp3 files and can tell which one has finished

CASE %MM_MCINOTIFY

IF CBWPARAM = %MCI_NOTIFY_SUCCESSFUL THEN

?????

END IF

Last edited by Steve Bouffe; Jan 6th, 2012 at 09:42 AM.
Reply With Quote
  #2  
Old Jan 6th, 2012, 11:04 AM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 37,111
>MCISENDSTRING( "play mp3 notify", "", 0, hDlg )



Perhaps you could create a separate callback window (not visible, or a message-only window) for each separate string and use the callback param of the MciSendString() function....

Quote:
hwndCallback
Handle to a callback window if the "notify" flag was specified in the command string.
... and when you get called back that playing completed you'll know which string has completed....

???

MCM
Reply With Quote
  #3  
Old Jan 7th, 2012, 05:39 AM
Steve Bouffe Steve Bouffe is offline
Member
 
Join Date: May 1999
Location: Chelmsford Essex, UK
Posts: 802
Thaks for the suggestion.

I added the following

Code:
FUNCTION MCI_Notify_Dialog_Init AS LONG

LOCAL hDlg AS LONG

DIALOG NEW 0, "", - 100, - 100, 1, 1 , TO MCI_NotifyDlgHan_GL

DIALOG SHOW MODELESS MCI_NotifyDlgHan_GL, CALL MCI_Notify_Proc

END FUNCTION

CALLBACK FUNCTION MCI_Notify_Proc AS LONG

SELECT CASE AS LONG CBMSG

CASE %MM_MCINOTIFY

IF CBWPARAM = %MCI_NOTIFY_SUCCESSFUL THEN

POSTMESSAGE EposDlgHan_GL, %WM_USER + 102, 0, 0

END IF

END SELECT

END FUNCTION
This works fine but whats a "message-only window" ?
Reply With Quote
  #4  
Old Jan 7th, 2012, 07:15 AM
Stuart McLachlan Stuart McLachlan is offline
Member
 
Join Date: Mar 2000
Location: Port Moresby, Papua New Guinea
Posts: 1,693
Quote:
Originally Posted by Steve Bouffe View Post
This works fine but whats a "message-only window" ?
A window which is only used to process callback messages and which the user doesn't see or interact with in any way ( Hence your negative screen co-ordinates and 1 pixel size).
Reply With Quote
  #5  
Old Jan 8th, 2012, 12:20 PM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 37,111
A message-only window is created by specifying certain values in the hWndParent param of your call to CreateWindowEx:
Quote:
hWndParent
[in] Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows.
Windows 2000/XP: To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window.
MCM
Reply With Quote
  #6  
Old Jan 8th, 2012, 06:51 PM
Stuart McLachlan Stuart McLachlan is offline
Member
 
Join Date: Mar 2000
Location: Port Moresby, Papua New Guinea
Posts: 1,693
To amplify MCMs comment:
Quote:
Message-Only Windows

A message-only window enables you to send and receive messages. It is not visible, has no z-order, cannot be enumerated, and does not receive broadcast messages. The window simply dispatches messages.
To create a message-only window, specify the HWND_MESSAGE constant or a handle to an existing message-only window in the hWndParent parameter of the CreateWindowEx function. You can also change an existing window to a message-only window by specifying HWND_MESSAGE in the hWndNewParent parameter of the SetParent function.
To find message-only windows, specify HWND_MESSAGE in the hwndParent parameter of the FindWindowEx function. In addition, FindWindowEx searches message-only windows as well as top-level windows if both the hwndParent and hwndChildAfter parameters are NULL.
It appears to work the same with DDT created dialogs if you use the constant %HWND_MESSAGE.

Last edited by Stuart McLachlan; Jan 8th, 2012 at 06:54 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:29 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1999-2011 PowerBASIC, Inc. All Rights Reserved.
Error in my_thread_global_end(): 1 threads didn't exit