15,949,686 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Inczu (Top 12 by date)
Inczu
28-Dec-23 5:34am
View
Iv'e found the solution. I have created a function out of "public partial class Form2 : Form". I had a code like this: public class User
{
public string Name { get; set; }
public bool IsSuperAdmin { get; set; }
} Above "public partial class Form2 : Form"
Inczu
3-Nov-23 11:03am
View
But now I dont want to put the password automatic from lusrmgr.msc or some Windows services in the textbox. I just want make sure that the selected user from listbox is in Windows services and selected user is write the correct password to textbox from Windows services.
Inczu
31-Oct-23 9:36am
View
When I select a Item from listbox, write wrong password and click on button 1 and 2 times then I have messagebox from code in button that user have 3 times to write correct password or it will block button and password textbox for 10 seconds. The code is blocking that what I want 10 seconds and at the end, user have a next message box from button that informs unlock password textbox and button but it didn't count the 10 seconds in another messagebox till the blocking starts.
Inczu
31-Oct-23 8:36am
View
The timer doesn't work, rest of the code is working fine.
Inczu
14-Sep-23 8:11am
View
I've delete rich edit control 2.0, create a edit control and stretch it. Now I will try to add some code so when the text will hit right vertical line it will go to the next text line
Inczu
14-Sep-23 4:41am
View
I've copy and paste your code but it still can't open ThirdDlg.
Inczu
14-Sep-23 4:33am
View
I've created ThirdDlg but it wouldn't open with rich edit control. Before rich edit control I had error but I could omit it and open ThirdDlg.
Inczu
7-Sep-23 6:00am
View
In my dialog combo box Properties Data username "Test" is 3 in the list
Inczu
7-Sep-23 5:54am
View
#pragma once
// CSecondDlg dialog
#include <vector>
#include "ThirdDlg.h"
class CSecondDlg : public CDialogEx
{
DECLARE_DYNAMIC(CSecondDlg)
public:
CSecondDlg(CWnd* pParent = nullptr); // standard constructor
virtual ~CSecondDlg();
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG1 };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
CComboBox m_ComboBox; // Deklaracja ComboBox
//afx_msg void OnEnChangeEdtUserName();
private:
CComboBox m_comboExistUser;
BOOL m_bRadioSelected; // Czy wybrano przycisk radio
BOOL m_bCheckedUserExist; // Czy kliknięto przycisk BtnDoUserExist()
BOOL m_bEditingUsername;
bool m_bShowUsernameWarning;
bool userChecked; // Dodaj tę zmienną prywatną do klasy CSecondDlg
bool m_bUserExistChecked;
CString strUser; // Declare a string to store user/group names
CString selectedType; // Deklaracja zmiennej przechowującej wybrany typ
//CEdit m_editPassword;
CEdit m_editCompanyName;
CEdit m_editUserName; // Zmienna przechowująca pole IDC_EDIT3
CEdit m_editWhichUser; // Zmienna przechowująca pole IDC_EDIT4
CEdit m_EditPassword;
PACL pDacl; // Declare a pointer to an access control list (ACL)
void UpdateEdtWichUser();
CString m_lastEdtWichUser;
DECLARE_MESSAGE_MAP()
public:
CString m_FirstPassword;
CString m_strCompanyName;
CString m_strServiceName;
CString m_strPortTCP;
CString m_strEditText; // Zmienna przechowująca wprowadzony tekst
CString m_strUserName; // Zmienna przechowująca nazwę użytkownika
CString enteredPassword;
CString expectedPassword;
CEdit m_EdtFirstPassword; // Zmienna dla pierwszego pola edycyjnego
CEdit m_EdtSecondPassword; // Zmienna dla drugiego pola edycyjnego
CEdit m_EditControl;
CEdit m_EdtUserName;
CButton m_CheckBox; // Zmienna dla kontrolki checkbox
CButton m_RadIsExist;
CButton m_RadIsntExist;
bool CheckUserExistence(const CString& userName);
virtual BOOL OnInitDialog();
static const std::vector<cstring> validUsernames;
CThirdDlg m_thirdDlg;
CComboBox m_ComboExistUser;
//void VerifyPassword();
afx_msg void BtnNextThirdDlg();
afx_msg void BtnBackServicesDlg();
afx_msg void CheckPassword();
afx_msg void EdtFirstPassword();
afx_msg void EdtSecondPassword();
afx_msg void RadIsntExist();
afx_msg void ComboExistUser();
afx_msg void RadIsExist();
afx_msg void EdtUserName();
afx_msg void EdtDoUserExist();
afx_msg void BtnDoUserExist();
afx_msg void OnBnClickedCancel();
afx_msg void BtnClearConfiguration();
afx_msg void BtnSearchUsers();
afx_msg void EdtWichUser();
};
Inczu
7-Sep-23 5:54am
View
// SecondDlg.cpp : implementation file
//
#include "pch.h"
#include "Services.h"
#include "SecondDlg.h"
#include "afxdialogex.h"
#include "ServicesDlg.h"
#include <windows.h>
#include <lm.h> // Dla NetUserGetInfo
#include <afxinet.h> // do używania klasy CWaitDialog
#include <afxwin.h>
#include <afxcmn.h>
#include <aclapi.h>
#include <sddl.h>
#include <winnetwk.h>
#include <activeds.h> // Dla CObjectPicker
#include <objsel.h>
#include <afxdb.h> // Jeśli używasz bazy danych
#include "ThirdDlg.h"
#pragma comment(lib, "netapi32.lib")
// CSecondDlg dialog
IMPLEMENT_DYNAMIC(CSecondDlg, CDialogEx)
CSecondDlg::CSecondDlg(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DIALOG1, pParent)
{
m_bUserExistChecked = FALSE; // Inicjalizacja flagi jako FALSE
}
CSecondDlg::~CSecondDlg()
{
}
void CSecondDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
//DDX_Control(pDX, IDC_EDIT3, m_editUserName);
//DDX_Control(pDX, IDC_EDIT4, m_editWhichUser);
}
BEGIN_MESSAGE_MAP(CSecondDlg, CDialogEx)
ON_EN_CHANGE(IDC_EDIT1, &CSecondDlg::EdtFirstPassword)
ON_EN_CHANGE(IDC_EDIT2, &CSecondDlg::EdtSecondPassword)
ON_EN_CHANGE(IDC_EDIT3, &CSecondDlg::EdtUserName)
ON_EN_CHANGE(IDC_EDIT4, &CSecondDlg::EdtWichUser)
ON_EN_CHANGE(IDC_EDIT6, &CSecondDlg::EdtDoUserExist)
ON_BN_CLICKED(IDC_BUTTON1, &CSecondDlg::BtnBackServicesDlg)
ON_BN_CLICKED(IDC_BUTTON2, &CSecondDlg::BtnNextThirdDlg)
ON_BN_CLICKED(IDC_BUTTON3, &CSecondDlg::BtnDoUserExist)
ON_BN_CLICKED(IDC_BUTTON4, &CSecondDlg::BtnClearConfiguration)
ON_BN_CLICKED(IDC_BUTTON5, &CSecondDlg::BtnSearchUsers)
ON_BN_CLICKED(IDC_RADIO1, &CSecondDlg::RadIsExist)
ON_BN_CLICKED(IDC_RADIO2, &CSecondDlg::RadIsntExist)
ON_CBN_SELCHANGE(IDC_COMBO1, &CSecondDlg::ComboExistUser)
ON_BN_CLICKED(IDC_CHECK1, &CSecondDlg::CheckPassword)
ON_BN_CLICKED(IDCANCEL, &CSecondDlg::OnBnClickedCancel)
END_MESSAGE_MAP()
// CSecondDlg message handlers
void CSecondDlg::BtnBackServicesDlg()
{
EndDialog(IDOK);
// Otwórz główne okno dialogowe
CServicesDlg dlg;
dlg.DoModal();
}
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
BOOL CSecondDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Inicjalizacja zmiennych
m_bShowUsernameWarning = true;
userChecked = false; // Ustawienie początkowej wartości zmiennej userChecked
m_bUserExistChecked = false;
//m_editUserName.SetEventMask(ENM_CHANGE);
m_bEditingUsername = false;
m_thirdDlg.Create(IDD_DIALOG2, this);
return TRUE;
}
//-------------------------------------------------------------------------------------------------
void CSecondDlg::EdtUserName()
{
// Pobierz zawartość pierwszego pola edycji
CString strUserName;
GetDlgItemText(IDC_EDIT3, strUserName);
// Ustaw zawartość drugiego pola edycji (EdtWichUser) na to, co wprowadził użytkownik
SetDlgItemText(IDC_EDIT4, strUserName);
EdtWichUser();
// Pobierz tekst z kontrolki EdtUserName()
CString userName;
GetDlgItemText(IDC_EDIT3, userName);
// Sprawdź, czy tekst to jeden z określonych użytkowników lokalnych
if (userName == _T("Gość") || userName == _T("Konto domyślne") || userName == _T("Test") || userName == _T("WDAGUtilityAccount"))
{
// Ustaw tekst w kontrolce EdtWichUser() na "użytkownik jest lokalny"
SetDlgItemText(IDC_EDIT4, _T("użytkownik jest lokalny "+ m_lastEdtWichUser));
}
else if (userName == _T("Dorota Gruzdas") ||
userName == _T("Edyta Wandzlewicz") ||
userName == _T("Karolina Domżał") ||
userName =
Inczu
29-Aug-23 5:17am
View
Thank you for helping me. Yesterday I've found good solution in AI :)
Inczu
29-Aug-23 5:17am
View
Thank you for helping me. Yesterday I've found good solution in AI :)
Show More