Click here to Skip to main content
15,887,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
mybm111-Sep-14 20:30
mybm111-Sep-14 20:30 
GeneralRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
Stefan_Lang12-Sep-14 1:42
Stefan_Lang12-Sep-14 1:42 
QuestionReg. Printing Pin
murali_utr10-Sep-14 17:09
murali_utr10-Sep-14 17:09 
QuestionRe: Reg. Printing Pin
Richard MacCutchan10-Sep-14 21:01
mveRichard MacCutchan10-Sep-14 21:01 
Questionerror C2451: conditional expression of type 'std::_Tree_iterator<_Mytree>' is illegal Pin
kamal197710-Sep-14 8:30
kamal197710-Sep-14 8:30 
AnswerRe: error C2451: conditional expression of type 'std::_Tree_iterator<_Mytree>' is illegal Pin
Graham Breach10-Sep-14 8:36
Graham Breach10-Sep-14 8:36 
GeneralThank you Very Much Graham Breach! Pin
kamal197710-Sep-14 13:11
kamal197710-Sep-14 13:11 
QuestionStrange random behavior of TB_HIDEBUTTON on Win7 Notification Toolbar buttons Pin
Will580110-Sep-14 3:47
Will580110-Sep-14 3:47 
(This does reference previous projects but I suggest deserves a new thread as it is a particular issue with TB_HIDEBUTTON and no other API).

I have discovered some apparently random behaviour of TB_HIDEBUTTON on Windows 7 64-bit. I have not tested on any other OS but suppose the problem will be duplicated to some degree or other.

First, I have a project (of my own) which successfully enumerates the toolbar buttons in the Notify Area.

One starting project to illustrate the idea, is this:
http://www.codeproject.com/Articles/10807/Shell-Tray-Info-Arrange-your-system-tray-icons
(This is an old project - for my Win7 it needs modifying to make the TBBUTTON structure fixed to 6 reserved bytes, also a mod to find the hwnd Win 7 "User Promoted Notification Area", so it's not a perfect sample but good enough to illustrate the type of code loop i'm using.)

I've used TB_BUTTONCOUNT to obtain a count of buttons on the Notification Toolbar, have entered a loop iterating over those items as i, and have created memory in the target process to retrieve the TBBUTTON structure and its TRAYDATA structure. I have then used GetWindowThreadProcessId to get tray.hwnd and from there have been able to extract all the required information in my loop regarding the target button. This all works.

The problem is, that being in my loop of i, I can successfully delete buttons with TB_DELETEBUTTON (and also, in the sample above with mods, can successfully use TB_MOVEBUTTON as well.) I'm therefore certain that my loop of i is pointing at the correct button. My pointer enumerator (actually an index i for SendMessage) appears to be, therefore, correct, as in, it is pointing at the correct button on the list in each iteration. That's logical.

However, TB_HIDEBUTTON produces bizarre and unexpected results - it hides the wrong button every time.

The only thing I can suppose in this circumstances is that the TB_HIDEBUTTON API has a wierd bug.

Can anyone confirm what is the problem hiding buttons with this API?


C++
// In a loop of "int i" enumerating TB_BUTTONCOUNT list of buttons:

// THIS WORKS, AND DELETES THE INDEXED Button
LRESULT hideResult = SendMessage(hTrayWnd, TB_DELETEBUTTON, i, 0 ); // always zero

// THE FOLLOWING CODE DOESN'T WORK, AND HIDES ANOTHER, (FAIRLY RANDOM) BUTTON,
// SOMETIMES APPEARING TO BE IN A SORT OF DISORGANIZED REVERSE-ORDER, I.E.
// IF YOU ATTEMPT TO HIDE A BUTTON TOWARDS THE FAR-LEFT OF THE NOTIFY AREA,
// IT ENDS UP HIDING A BUTTON TOWARDS THE FAR RIGHT, AS THOUGH THE INDEX OF THE ARRAY WAS REVERSED, THOUGH THIS IS NOT QUITE REPRODUCEABLE)

LRESULT hideResult = SendMessage(hTrayWnd, TB_HIDEBUTTON, i, 1 ); // 1 to hide, 0 to show

AnswerRe: Strange random behavior of TB_HIDEBUTTON on Win7 Notification Toolbar buttons Pin
Richard MacCutchan10-Sep-14 4:05
mveRichard MacCutchan10-Sep-14 4:05 
GeneralRe: Strange random behavior of TB_HIDEBUTTON on Win7 Notification Toolbar buttons Pin
Will580110-Sep-14 6:56
Will580110-Sep-14 6:56 
QuestionMATLAB C/C++ Pin
mohamed sabri8-Sep-14 7:18
mohamed sabri8-Sep-14 7:18 
AnswerRe: MATLAB C/C++ Pin
Kenneth Haugland8-Sep-14 8:02
mvaKenneth Haugland8-Sep-14 8:02 
QuestionIs Edit and continue support available for X64 application in VS2010 ? Pin
sma123#4-Sep-14 21:01
sma123#4-Sep-14 21:01 
AnswerRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Richard MacCutchan4-Sep-14 21:15
mveRichard MacCutchan4-Sep-14 21:15 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
sma123#4-Sep-14 22:24
sma123#4-Sep-14 22:24 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Richard MacCutchan4-Sep-14 23:58
mveRichard MacCutchan4-Sep-14 23:58 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
sma123#5-Sep-14 3:14
sma123#5-Sep-14 3:14 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Richard MacCutchan5-Sep-14 3:28
mveRichard MacCutchan5-Sep-14 3:28 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Albert Holguin5-Sep-14 5:29
professionalAlbert Holguin5-Sep-14 5:29 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
jschell5-Sep-14 10:02
jschell5-Sep-14 10:02 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Albert Holguin8-Sep-14 2:50
professionalAlbert Holguin8-Sep-14 2:50 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Stefan_Lang11-Sep-14 3:05
Stefan_Lang11-Sep-14 3:05 
GeneralRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Albert Holguin11-Sep-14 3:26
professionalAlbert Holguin11-Sep-14 3:26 
AnswerRe: Is Edit and continue support available for X64 application in VS2010 ? Pin
Randor 5-Sep-14 10:29
professional Randor 5-Sep-14 10:29 
QuestionReturn bidimensional array Pin
_Flaviu4-Sep-14 2:07
_Flaviu4-Sep-14 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.