Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCitarpor ej el metodo conocido como de burbujaEs poco eficiente. Menos code y mas eficiente es el método de selección directa. Por otra parte está utilizando variables simples con lo cual queda descartado cualquier método de ordenación.
CitarA mí me agrada tal cual como está. .
Option Explicit
Private Declare Function SetErrorMode Lib "kernel32" (ByVal wMode As Long) As Long
Private Declare Sub InitCommonControls Lib "Comctl32" ()
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _
ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Private Const SW_SHOW = 5
Private Const SW_HIDE = 0
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_RBUTTONUP = &H205
Private Const KEY_TOGGLED As Integer = &H1
Private Const KEY_PRESSED As Integer = &H1000
Private Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Dim sysTray As NOTIFYICONDATA
Private Sub Command1_Click()
MsgBox " Hacer Doble click en el ícono para reestaurar el Form", vbInformation, "SH_DEKTOP"
Call Colocar_Tray(1000)
End Sub
Private Sub Command2_Click()
Call Quitar_Systray
End Sub
Sub Colocar_Tray(Intervalo As Integer)
With sysTray
.cbSize = Len(sysTray)
.hwnd = Me.hwnd
.uId = 1&
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.ucallbackMessage = WM_LBUTTONDOWN
.hIcon = Image1.Picture
End With
Call Shell_NotifyIcon(NIM_ADD, sysTray)
Me.Hide
Timer1.Interval = Intervalo
End Sub
Sub Quitar_Systray()
With sysTray
.cbSize = Len(sysTray)
.hwnd = Me.hwnd
.uId = 1&
End With
Call Shell_NotifyIcon(NIM_DELETE, sysTray)
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Initialize()
Call SetErrorMode(2)
Call InitCommonControls
Me.Caption = "SH_DEKTOP"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim msg
msg = X / Screen.TwipsPerPixelX
If msg = WM_LBUTTONDBLCLK Then
mnuMostrar_Click
ElseIf msg = WM_RBUTTONUP Then
Me.PopupMenu mnuPopup
End If
End Sub
Private Sub mnuMostrar_Click()
Timer1.Interval = 0
Me.Show
End Sub
Private Sub mnuSalir_Click()
Unload Me
End Sub
Private Sub Timer1_Timer()
sysTray.hIcon = Image1.Picture
Call Shell_NotifyIcon(NIM_MODIFY, sysTray)
End Sub
Private Sub Form_Load()
Image1.Visible = False
Command1.Caption = " Colocar en el systray "
Command2.Caption = " Quitar del sysTray "
Command3.Caption = "Salir"
Timer2.Enabled = True
Timer2.Interval = 100
End Sub
Private Sub Form_Unload(Cancel As Integer)
Quitar_Systray
End
End Sub
Private Sub Timer2_Timer()
If GetKeyState(vbKeyF10) And KEY_PRESSED Then
Dim HWND_Escritorio As Long
On Error Resume Next
HWND_Escritorio = FindWindowEx(0&, 0&, "Progman", vbNullString)
Call ShowWindow(HWND_Escritorio, SW_HIDE)
ElseIf GetKeyState(vbKeyF11) And KEY_PRESSED Then
On Error Resume Next
HWND_Escritorio = FindWindowEx(0&, 0&, "Progman", vbNullString)
Call ShowWindow(HWND_Escritorio, SW_SHOW)
End If
End Sub
CitarEn otras palabras buscas un programador para que te lo programe?
Dulces Lunas
#include <iostream>
int main()
{
int NUM,B,D,N;
std::cout<<"Ingrese numero"<<std::endl;
std::cin>>NUM;
std::cout<<"Ingrese B"<<std::endl;
std::cin>>B;
for(int i=0;i<=NUM;i++)
{
N=i;
do
{
D=N%10;
N=N/10;
}while((N=0)||(D>=B));
if(D<B)
std::cout<<i<<std::endl;
}
return 0;
}
#include <iostream>
int main()
{
int K,P,S,C,N,i;
P=1;
S=1;
C=1;
std::cout<<"Ingresa cantidad"<<std::endl;
std::cin>>K;
std::cout<<"1"<<",";
while(C<K)
{
N=P+S;
i=2;
while(N%i!=0){i++;}
if(i==N)
{
std::cout<<N<<",";
C++;
}
P=S;
S=N;
}
return 0;
}
#include <iostream>
int main()
{
int NUM,N,i,c;
std::cout<<"Ingrese NUM"<<endl;
std::cin>>NUM;
N=NUM;
i=2;
while(N!=1)
{
c=0;
while(N%i==0)
{
c++;
N=N/i;
}
if(c!=0){std::cout<<i<<","<<c<<std::endl;}
i++;
}
system("pause");
return 0;
}