Click here to Skip to main content
15,888,113 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Remoting: Switching between MBR and MBV at run-time. Pin
nitikin1-Jul-07 23:36
nitikin1-Jul-07 23:36 
GeneralRe: Remoting: Switching between MBR and MBV at run-time. Pin
Andy L 23-Jul-07 10:01
Andy L 23-Jul-07 10:01 
QuestionProblem in converting WinHelp to HTML Help [modified] Pin
asha_cybergirl26-Jun-07 22:36
asha_cybergirl26-Jun-07 22:36 
QuestionCommon DLL storage Pin
tri59525-Jun-07 23:22
tri59525-Jun-07 23:22 
AnswerRe: Common DLL storage Pin
Manas Bhardwaj25-Jun-07 23:42
professionalManas Bhardwaj25-Jun-07 23:42 
GeneralRe: Common DLL storage Pin
tri59525-Jun-07 23:46
tri59525-Jun-07 23:46 
GeneralRe: Common DLL storage Pin
Vasudevan Deepak Kumar29-Jun-07 1:42
Vasudevan Deepak Kumar29-Jun-07 1:42 
QuestionHow to Activate A Control Added to Desktop Pin
Nagaraju_Focus25-Jun-07 20:43
Nagaraju_Focus25-Jun-07 20:43 
I have Created A ListBox Control Whose Handle is Desktop.



My code for ListBox:

#using <mscorlib.dll>

using namespace System;

using namespace System::ComponentModel;

using namespace System::Collections;

using namespace System::Windows::Forms;

using namespace System:ata;

using namespace System:rawing;

using namespace System::Runtime::InteropServices;

using namespace System::Security::Permissions;





namespace DeskTopTest

{

///

/// Summary for MyListBox

///


// Requires unmanaged code

[assembly: SecurityPermissionAttribute (SecurityAction::RequestMinimum, UnmanagedCode=true)];

// Requires ability to create any window type

[assembly:UIPermissionAttribute(SecurityAction::RequestMinimum, Window=UIPermissionWindow::AllWindows)];

public ref class MyListBox : public ListBox

{

public:

MyListBox(void)

{


}

protected: virtual property System::Windows::Forms::CreateParams^ CreateParams

{


virtual System::Windows::Forms::CreateParams^ get() override

{

const int WS_EX_TOOLWINDOW = 0x00000080;

const int WS_EX_NOACTIVATE = 0x08000000;

const int WS_EX_TOPMOST = 0x00000008;

try

{

System::Windows::Forms::CreateParams ^p =ListBox::CreateParams;

p->ExStyle |= (WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST);

p->Parent = IntPtr::Zero;

return p;

}

catch (Exception^ e)

{

return nullptr;

}




}

}

public:[DllImport("user32.dll")] static int SetParent( IntPtr hWndChild, IntPtr hWndNewParent);

[DllImport("user32.dll")] static int ShowWindow( IntPtr hWnd, int nCmdShow);

[DllImport("user32.dll")] static IntPtr GetDesktopWindow(void);



public: void ShowFloating()

{


if (this->Handle == IntPtr::Zero)

{

ListBox::CreateControl();

}

//IntPtr s=GetDesktopWindow();

int x=SetParent(ListBox::Handle, IntPtr::Zero);

x=ShowWindow(ListBox::Handle,1);


}

protected:

virtual void WndProc(Message% m)override

{

ListBox::WndProc(m);

}


};

}





but when i Added this listbox to my form like:



MyListBox ^lst=gcnew MyListBox();

lst->Location=System:rawing::Point(264, 166);

lst->Name = L"comboBox1";

lst->TabIndex = 1;

lst->Visible=false;

lst->Size = System:rawing::Size(171, 200);

for (UInt16 i=1;i<100;i++)

{

lst->Items->Add("Item"+i.ToString());

}

lst->ShowFloating();



and calling the function ShowFloating();

It is working fine.

But I cant unable to focus On my Listbox & cant able to use my mouse events.



I want to focus on listbox.



Plz Suggest me .........



Thanks in advance


Nagaraju
QuestionData connection wizard Pin
lildiapaz25-Jun-07 15:03
lildiapaz25-Jun-07 15:03 
AnswerRe: Data connection wizard Pin
nitikin2-Jul-07 1:27
nitikin2-Jul-07 1:27 
QuestionMemory management and memory leaks Pin
Giorgi Dalakishvili25-Jun-07 8:55
mentorGiorgi Dalakishvili25-Jun-07 8:55 
AnswerRe: Memory management and memory leaks Pin
Dave Kreskowiak25-Jun-07 10:02
mveDave Kreskowiak25-Jun-07 10:02 
GeneralRe: Memory management and memory leaks Pin
Paul Conrad25-Jun-07 15:06
professionalPaul Conrad25-Jun-07 15:06 
GeneralRe: Memory management and memory leaks Pin
Giorgi Dalakishvili25-Jun-07 20:37
mentorGiorgi Dalakishvili25-Jun-07 20:37 
GeneralRe: Memory management and memory leaks Pin
originSH25-Jun-07 22:19
originSH25-Jun-07 22:19 
GeneralRe: Memory management and memory leaks Pin
Dave Kreskowiak26-Jun-07 2:42
mveDave Kreskowiak26-Jun-07 2:42 
GeneralRe: Memory management and memory leaks Pin
originSH26-Jun-07 2:44
originSH26-Jun-07 2:44 
QuestionHow to build a IP LAN Scanner in .Net Pin
Carmine_XX25-Jun-07 4:49
Carmine_XX25-Jun-07 4:49 
AnswerRe: How to build a IP LAN Scanner in .Net Pin
Ilya Verbitskiy8-Jul-07 1:18
Ilya Verbitskiy8-Jul-07 1:18 
GeneralRe: How to build a IP LAN Scanner in .Net Pin
Carmine_XX8-Jul-07 4:41
Carmine_XX8-Jul-07 4:41 
GeneralRe: How to build a IP LAN Scanner in .Net Pin
Ilya Verbitskiy8-Jul-07 21:19
Ilya Verbitskiy8-Jul-07 21:19 
QuestionGenerics, Inheritance and frustration Pin
Santiago Perez25-Jun-07 2:38
Santiago Perez25-Jun-07 2:38 
AnswerRe: Generics, Inheritance and frustration Pin
Andy L 225-Jun-07 7:10
Andy L 225-Jun-07 7:10 
GeneralRe: Generics, Inheritance and frustration Pin
Santiago Perez25-Jun-07 8:32
Santiago Perez25-Jun-07 8:32 
GeneralRe: Generics, Inheritance and frustration Pin
Andy L 226-Jun-07 0:16
Andy L 226-Jun-07 0:16 

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.